Jump to content

[SOLVED] PHP error logging in Apache


mariachimike

Recommended Posts

This issue may be more Apache related, but here goes anyway:

 

I've set the following values in my php.ini file:

log_errors =On

error_log_ =/var/log/php_log

 

However, all PHP errors still end up in the Apache error log and the php_log file is still empty. I want to separate PHP errors from the Apache errors to make it easier to search. Is there some other setting I need to set in order to make Apache log PHP errors to the file I chose in my php.ini?

 

 

Link to comment
https://forums.phpfreaks.com/topic/72735-solved-php-error-logging-in-apache/
Share on other sites

Well, the solution was a bit strange.

 

My original log location was this:

/var/log/httpd/php_error_log

 

After failing with 777 permissions and changing to the owner to "apache", I moved the log to this location:

/var/log/php/php_error_log

 

and voila! It worked! So, my theory is that if you put the PHP error log in the same directory where Apache is doing its logging, it will log your PHP errors to the Apache error log and not the file you set in your PHP configuration.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.