it is impossible to handle fatal errors using a special error handler.
The best solution is to simply enable error logging (e.g. syslog) in your php.ini, and then use a tool like logcheck / logsentry to get regular messages about unusual syslog entries.
Instead of syslog, PHP can also write errors to a file - just look at the error logging options in php.ini.
log_errors = On error_log = syslog error_log = /path/to/some/folder/phperrors.log
Obviously, you want to use only one of the error_log lines.
source share