php在代码中开启或关闭错误提示并将错误写入日志
//ini_set(‘error_reporting‘, 0); ini_set(‘error_reporting‘,E_ALL);//设置报告错误级别 $debug = false; if($debug){ //为true时,将错误显示在浏览器 ini_set("display_errors","on"); ini_set("log_errors","off"); }else{ //为false时,将错误写入报告文件中,不显示在浏览器 ini_set("display_errors","off"); ini_set("log_errors","on"); //错误日志 ini_set("error_log", __DIR__ . "/logs/".date("Ymd",time()).".log"); }
相关推荐
逍遥友 2020-11-20
cunxinwenwu的IT 2020-05-28
JF0 2020-05-08
cyhgogogo 2020-05-03
CloudXli 2020-04-20
vshacker 2020-01-09
Cyuhong 2019-04-24
igogo00 2015-07-28
迈克揉索芙特 2008-09-07
如狼 2014-04-04
技术渣 2014-11-14
Ping 2016-11-17
youandme 2018-06-09
wqcong 2016-02-16
xiaopc 2016-04-09
Trisyp 2016-02-17
zxj0 2017-07-28
JasonYeung 2016-06-26
PythonGCS 2015-05-28