The PHP error_log method does not write errors to the custom error log file. It will only write to /var/log/apache2/php_error.log
Here are the logging settings in my php.ini
:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
display_errors = Off
log_errors = On
log_errors_max_len = 0 ; also tried with 9999999
error_log = /var/log/apache2/php_errors.log
PHP writes its errors to the regular Apache error log (/var/log/apache2/error.log
) rather than the one I specified above.
Things I already tried:
- I stopped and restarted apache after changing the php.ini file
- The file
/var/log/apache2/php_errors.log
is 777 permissions and the file exists. - There are no other overriding php.ini files. (There is /etc/php5/cli/php.ini but I'm not using cli).
- There are no other error_log = xxx settings further down the php.ini file which could overrule the first one
- phpinfo() says error_log = /var/log/apache2/php_errors.log (i.e. the correct file), both under Local Value and Master Value
- The test script I'm using to generate errors doesn't contain any ini_set calls
(FYI: I'm using Apache/2.2.17 and PHP/5.3.5-1ubuntu7.2 on Ubuntu 11.04)
What am I doing wrong?