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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.