I run an apache 1.3 cpanel server centOS, php 5 mysql 5.
I am running php suexec
I am trying to set up error logging to email me every time a php error is encountered, instead of just logging it to a file
Currently errors are logged localy (the folder the script is in)
As a start, I have set error_log= /var/log/php/php_error_log
No errors are being logged to this file though.
I have set permissions to -rw-r--r-- 1 nobody root (I also tried root:root)
I am concerned it might be a file ownership problem. I have read the log file needs to be owned by the same owner as the script that generates the error. If so, then would it be impossible to have all php errors on the server log to the same file (many different accounts)?
If so, is there a way around this?
Anyway, back to what I am trying to accomplish: emailing me every time there is a php or mysql error.
Is this possible, and could I get some pointers on how to set it up.
I have googled this quite a bit, with not much luck. The best info I found was here:
But I still couldnt find exactly what I was looking for.
Also, if possible it would be nice if I could specify that it would email only on certain errors, or types of errors.
What I am most interested is mysql errors, but basically all fatal php errors.
The idea is to have all visual error reporting off, so no errors are displayed to the web page, but to be sent an email every time an error occurs.
If possible, it would be fantastic if this email could be customized, to perhaps contain some custom info like perhaps the query that failed, or the page and line number that casued the error, and especially to have the account name in the email, or better yet the subject line.
I currently have done this on a per site basis for many sites, using php error handling in the scripts on the site, but what I want to know, is is it possible to configure this server wide.