Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer 1

The following should fix you up ;-)

touch /var/log/php_errors.log
chown www-data: /var/log/php_errors.log
share|improve this answer
    
Thanks, I tried that to and still no errors. –  Michael Prescott Aug 13 '10 at 13:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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