Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to execute a shell or PHP script everytime my PHP throw an Error.

The only way I see actualy is to watch in real time all the .error.log file in /var/log/apache2, but it would require a deamon or longrunning script ? And I don't know how to do that.

In my dreams, I should be able to give command line to Apache / PHP, launched at EVERY error on every virtualhost.

Just to let you know, I want to do this on a developper laptop, not on production servers. I want to throw a notify-send on my Ubuntu :-) How cool is that?

share|improve this question

1 Answer 1

Use set_error_handler to write custom error handler to call script and auto prepend that script with auto_prepend_file...
Also, idea is stupid ... On dev enviroments debugger should be used to inspect unhandled errors.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.