首页 > 编程 > PHP > 正文

php linux环境显示站点错误信息

2019-11-14 10:35:24
字体:
来源:转载
供稿:网友
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");
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表