Jump to content

PHP errors not displaying


kiskadee

Recommended Posts

Why are my PHP scripts errors not being displayed? Instead, the server is throwing a 500 internal error.

 

I've already tried to add the 'display_errors' php flag to .htaccess file, but it doesn't seem to work, it keeps on returning the same 500 error.

 

My site url is: kiskadee.heliohost.org

 

Thanks in advance for any kind of help.

Link to comment
Share on other sites

It sounds like it might be helpful to point out, for any users who've just discovered lots of error messages suddenly announcing themselves to the public, that error display in pages can be disabled with the "display.errors = off" setting in a .user.ini file placed in the web pages directory.

 

Errors can be set to be written to a file using these directives:

log_errors = on
error_log = "~/logs/phperrors.txt"

 

"~/logs/phperrors.txt" could be any other directory that's convenient. "error_reporting =" can also be included to determine which errors get written/displayed (see the PHP manual for option descriptions).

 

I also have "display_startup_errors = off", but that probably isn't now on by default.

Link to comment
Share on other sites

error_reporting(0);

Added to the code will also prevent their display.

 

Our system already logs the errors to error_log in the same folder as the script, though your method should allow you to prevent the logging or change the filename or location if desired.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...