I need PHP errors not to be displayed but logged. I am using PHP 5.4 My current code to log errors in my php.ini is:
log_errors = 1
error_log = "/path-to-file/error_log.txt"
Which works however I am getting a 500 internal server error trying to turn error displaying off using display_errors
. I have tried using the following, all returning 500 errors.
display_errors = 0
display_errors = "0"
display_errors = false
display_errors = "false"
display_errors = Off
display_errors = "Off"
According to the PHP documentation, as of PHP 5.4, it is a string. What am I suppose to set display_errors
to to turn error displaying off?
a 500 error code means there is an invalid server configuration. This is most likely coming from Apache and not from php.
To get a clear understanding on what is giving you the error, look at your apache logs.
If you wish to also hide the 500 error, you could open your httpd.conf file and add
ErrorDocument 500 " "
Then make sure to restart apache. Any time you make a config change to php.ini or httpd.conf you will need to restart apache for it to take into effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With