Jump to content

[SOLVED] Won't write PHP errors to error_log


cameronjdavis

Recommended Posts

I want apache and php to write php errors to my own error_log.

It half works. PHP startup errors are going to my custom log. Runtime errors/warnings etc are going into the apache error log. I want them in my custom error_log file.

 

- I've set the error_log value to my file.

- I've set log_errors = On

- I've set display_errors = Off

- I've set display_startup_errors = Off

 

Is there a gotcha I don't know about it?

Link to comment
Share on other sites

Funny you should say that. Technically it is and then it isn't. I have solved the issue.

 

When apache starts php it runs as root and generates the php error file as root. PHP writes it's startup errors to the error file.

 

Apache then changes user and can no longer write to the file. Thanks for the reply. Problem solved.

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.