| |
打开PHP中error_reporting后出现一堆notice错误信息。其实,可以关闭,一般notice都是变量未定义,php是弱类型定义语言,不需要定义后再用 。notice级别的报错,一般来说都是变量没有初始化,在一般安全性要求不严格的场合,可以忽略,但是如果你的安全性要求特别高的话,还是建议消除所有的notice信息,这样可以有效的防止攻击。看下面实例说明了error_reporting的用法。(文章原创,欢迎转载http://www.benxiaohai.com/read.php/429.htm)

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>
Tags:
by admin | 来自 本站原创 | 不指定 2007-10-23 16:26 | 分类: PHP | 评论(1) | 引用(6) | 阅读(883)
gfskygui Email Homepage
2008-5-12 11:05
458649409
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]