
在php.ini文件中修改error_reporting改成: (引荐进修:yii教程)
error_reporting=E_ALL & ~E_NOTICE
假如你不能操纵php.ini文件,你能够运用以下要领在你想制止notice毛病提醒的页面中到场以下代码:
/* 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 mode defined('YII_DEBUG') or define('YII_DEBUG',true); // specify how many levels of call stack should be shown in each log message defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); require_once($yii); Yii::createWebApplication($config)->run();
以上就是yii封闭毛病提醒的细致内容,更多请关注ki4网别的相干文章!