
在php.ini文件中改动error_reporting改为: (推荐学习:yii教程)
error_reporting=E_ALL & ~E_NOTICE
如果你不能操作php.ini文件,你可以使用如下方法在你想禁止notice错误提示的页面中加入如下代码:
挖错网
一款支持文本、图片、视频纠错和AIGC检测的内容审核校对平台。
28 查看详情
/* Report all errors except E_NOTICE */error_reporting(E_ALL^E_NOTICE);
使用以上方法,在YII的入口文件中protected/index.php
error_reporting(E_ALL^E_NOTICE);// change the following paths if necessary$yii=dirname(__FILE__).'/../framework/yii.php';$config=dirname(__FILE__).'/protected/config/main.php'; //引用系统常量配置文件require_once dirname(__FILE__).'/protected/config/constant.php'; // remove the following lines when in production modedefined('YII_DEBUG') or define('YII_DEBUG',true);// specify how many levels of call stack should be shown in each log messagedefined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); require_once($yii);Yii::createWebApplication($config)->run();
以上就是yii关闭错误提示的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/364816.html
微信扫一扫
支付宝扫一扫