I'm running Apache2 on Ubuntu 10.04 LTS. I've configured /etc/php5/apache2/php.ini with the following:

error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
log_errors = On
error_log = /var/log/php_errors.log

I have a PHP application that I believe has an error in it. With those settings and the suspected error, no php_errors.log was created. So, I created a PHP file with syntax errors. Still no php_errors.log. What are some reasons why PHP would not log errors?

Could it be permissions? I see that /var/log is owned by root:root. I don't know what owns the php process. I believe root starts the apache process and then a new starts a new thread using www-data:www-data for serving files. Would that mean I need to change permissions on the /var/log folder?

  • Try putting the log file in the apache log directory /var/log/apache2/php_errors.log, do not change the permissions on the /var/log folder – topdog Aug 13 '10 at 4:39
  • Thanks, I changed the error log path as you suggested by I'm still seeing no errors. – Michael Prescott Aug 13 '10 at 13:11

The following should fix you up ;-)

touch /var/log/php_errors.log
chown www-data: /var/log/php_errors.log
  • Thanks, I tried that to and still no errors. – Michael Prescott Aug 13 '10 at 13:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.