error_reporting(E_ALL);
//开启报错
function cache_shutdown_error() {
// 获取错误信息
$_error = error_get_last();
// 存在错误时输出
if ($_error && in_array($_error['type'], array(1, 4, 16, 64, 256, 4096, E_ALL))) {
header("Content-type: text/html; charset=utf-8");
echo '<font color=red>你的代码出错了:</font></br>';
echo '致命错误:' . $_error['message'] . '</br>';
echo '文件:' . $_error['file'] . '</br>';
echo '在第' . $_error['line'] . '行</br>';
}
}
register_shutdown_function("cache_shutdown_error");
php linux环境显示站点错误信息
最新推荐文章于 2021-08-26 11:36:46 发布