用.htaccess设置显示PHP错误
使用.htaccess可以在某种程度上更改PHP的错误显示的设置,实际上,相当于更 改PHP.ini的参数,很是方便。
将以下相应代码放到对应目录中的.htaccess文件,即可实现相应功能。
关 闭错误显示 :
php_flag display_startup_errors off php_flag display_errors off php_flag html_errors off php_value docref_root 0 php_value docref_ext 0
只 显示PHP错误 :
php_flag display_errors on php_flag display_startup_errors on php_value error_reporting 2047
其 中,“2047”为要显示的错误的级别,详细表格如下:
1 E_ERROR