Usually the program has a fatal error when the page blank, want to get error information is not difficult! The main use of two functions:
Error_get_last () Gets the last error message : Print_r () After the structure is as follows:
Array ( = 8 = Undefined variable: a [file] = C:\WWW\index. php = 2)
Register_shutdown_function () registers a callback function when the script stops executing:
error_reporting(E_all);//E_all functionCache_shutdown_error () {$_error=Error_get_last (); if($_error&&In_array($_error[' type '],Array(1, 4, 16, 64, 256, 4096,E_all))) { Echo' <font color=red> Your code went wrong:</font></br> '; Echo' Fatal error: '.$_error[' Message ']. ' </br> '; Echo' File: '.$_error[' File ']. ' </br> '; Echo' In the first. '$_error[' Line ']. ' Line </br> '; }} register_shutdown_function("Cache_shutdown_error");
PHP Automatic capture monitoring fatal error (500 error) Error_get_last () Gets the last error message register_shutdown_function () registers a callback function when the script stops executing