On a Ubuntu web server [LAMP], I'm trying to get PHP errors to write into a php_error file, but no matter what I do, they keep going to the apache log.
Here's what I have tried/done:
Edited the php.ini file:
- error_reporting = E_ALL | E_STRICT
- display_error = Off
- log_errors = On
- error_log = /var/log/php_errors.log
Restarted Apache
Checked the
phpinfo()
output to verify that the changes I made to the php.ini file took -- they did.After verifying that the errors were still going to the Apache log, I physically created the php_errors.log and tried again. Still going to the Apache log!
Rebooted the web server! Still...!
Anybody have a solution?
log_errors_max_len
is greater than 0 – DevlshOne/var/log/php_errors.log
? You may need to place that inside a location Apache can write to like/var/log/httpd/php_errors.log
or/var/log/apache2/php_errors.log
– Michael Berkowski