您好,欢迎访问一九零五行业门户网

php获取错误信息

php获取错误信息
function error_reg(){ $ar=array( e_error => 'error', e_warning => 'warning', e_parse =>'prase', e_notice => 'notice' ); register_shutdown_function(function() use ($ar){ $ers=error_get_last(); if($ers['type']!=8 && $ers['type']){ $er=$ar[$ers['type']].$ers['type'].': '.' '.$ers['message'].' => '.$ers['file'].' line:'.$ers['line'].' '.date('y-m-d h:i:s')."\n"; error_log($er,3,'/tmp/php_error.log'); } }); set_error_handler(function($a,$b,$c,$d) use ($ar){ if($a!=8 && $a){ $er=$ar[$a].$a.': '.$b.' => '.$c.' line:'.$d.' '.date('y-m-d h:i:s')."\n"; error_log($er,3,'/tmp/php_error.log'); } },e_all ^ e_notice); }
以上就是php获取错误信息的内容。
其它类似信息

推荐信息