PHP:将电子邮件通知发送到我的电子邮件ID如果在任何页面中发现500内部错误

How can we know 500 internal error occurred in any PHP Script..So i want to received mail notification on my email ID Like

500 error found on /home/user/data/xyz.php at 03/05/2014 : 10.20 PM 

Note: I am use WHM/cPanel

With apache you can create a .htaccess file, put a command like this in the htaccess file

ErrorDocument 500 /path/to/your/email/script.php

Every time a 500 error occurs apache will redirect to that file.

Here is a full explanation

http://www.totallyphp.co.uk/custom-error-pages-using-htaccess

and these are the official apache docs

http://httpd.apache.org/docs/current/mod/core.html#errordocument