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

    xiaoxiao2021-03-26  19

    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");
    转载请注明原文地址: https://ju.6miu.com/read-658455.html

    最新回复(0)