Hi all,
I've a problem handling errors for my site...
I include this file in each page to handling errors, but I'm not able to handle each errors.
Parse error: parse error in /u/WWW/mysite/cgi-bin/login.php on line 10
PHP Fatal error: Allowed memory size of 5242880 bytes exhausted (tried to allocate 7262 bytes) in /u/WWW/mysite/cgi-bin/functions.inc.php on line 380
For example I'm not able to handle the above errors..... Why not ???
Here is the code I use
P.S Sorry for my bad english..... ;-)
<?
// error handler function
function myErrorHandler ($errno, $errstr, $errfile, $errline) {
global $PHP_SELF;
if(isset($PHP_SELF))
$r_uri = $PHP_SELF;
else
$r_uri = "NO REFERER";
if($errno !=8) { //Undefined variable
$err_msg = "Unknown error type: [$errno] $errstr\n";
$err_msg .= "Unknown Error in line ".$errline." of file ".$errfile;
$err_msg .= "\nFile :".$r_uri."\n";
$err_msg .= "----------------------------\n\n";
ExternalMail(ERROR_MAIL, ME, "ERROR IN ".$SERVER_NAME, $err_msg);
}
}
// set the error reporting level for this script
// error_reporting (ERROR | WARNING | PARSER | NOTICE);
// error_reporting (E_ALL);
error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING);
$old_error_handler = set_error_handler("myErrorHandler");
?>