请问怎么关错误提示呀?像notice什么的,就直接屏蔽掉? [ 新手入门 ]
请问怎么关错误提示呀?像notice什么的,就直接屏蔽掉?
在入口文件那屏蔽掉:defined('YII_DEBUG') or define('YII_DEBUG',true);
但是出现500错误时就没办法了。
开发情况是,我在controller里做数据库增删改时,同时更新memcache里的值。当memcache连接失败时,并不影响数据库的操作,现在的情况是,memcache连不上时,直接500错误,程序停掉了。 请高手帮忙谢谢
共 4 条回复
-
php.ini中配置:
error_reporting = E_ALL & ~E_NOTICE
除了NOTICE,其他都显示。
还有很多错误级别:; E_ALL - All errors and warnings (doesn't include E_STRICT) ; E_ERROR - fatal run-time errors ; E_RECOVERABLE_ERROR - almost fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initialized to an ; empty string) ; E_STRICT - run-time notices, enable to have PHP suggest changes ; to your code which will ensure the best interoperability ; and forward compatibility of your code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING - user-generated warning message ; E_USER_NOTICE - user-generated notice messag
design231 好好学yii
注册时间:2012-11-02
最后登录:2013-07-31
在线时长:0小时0分
最后登录:2013-07-31
在线时长:0小时0分
- 粉丝1
- 金钱325
- 威望0
- 积分325