note 91535 added to function.set-error-handler
| From: | nizamgok at gmail dot com | Date: | Tue, 16 Jun 2009 02:27:50 +0000 |
| Subject: | note 91535 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156904@lists.php.net to get a copy of this message | ||
I have realized that a few people here mentioned that you cannot capture parse errors (type 4,
E_PARSE). This is not true. Here is how I do. I hope this helps someone.
1) Create a "auto_prepend.php" file in the web root and add this:
register_shutdown_function('error_alert');
function error_alert()
{
if(is_null($e = error_get_last()) === false)
{
mail('user@site.com', 'Error from auto_prepend', print_r($e,
true));
}
}
2) Then add this "php_value auto_prepend_file /www/auto_prepend.php" to your .htaccess
file in the web root.
* make sure you change the email address and the path to the file.
----
Server IP: 219.94.145.73
Probable Submitter: 122.208.20.66
----
Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php
Edit -- https://master.php.net/note/edit/91535
Del: integrated -- https://master.php.net/note/delete/91535/integrated
Del: useless -- https://master.php.net/note/delete/91535/useless
Del: bad code -- https://master.php.net/note/delete/91535/bad+code
Del: spam -- https://master.php.net/note/delete/91535/spam
Del: non-english -- https://master.php.net/note/delete/91535/non-english
Del: in docs -- https://master.php.net/note/delete/91535/in+docs
Del: other reasons-- https://master.php.net/note/delete/91535
Reject -- https://master.php.net/note/reject/91535
Search -- https://master.php.net/manage/user-notes.php