当前位置:编程学习 > php >>

yii开启调试模式

yii开启调试模式

 
1.先看一下项目的config文件是哪里的

$config = dirname(__FILE__) . '/protected/config/main.php';

2.看一下有没有如下的代码,没有的话直接添加上

define('YII_DEBUG', true); //是否调试BUG,本地测试请打开
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);

3.按照第一步的路径找到项目对应相应的main文件,在里面加上如下代码

'log' => array(
      'class' => 'CLogRouter',
      'routes' => array(
        array( // configuration for the toolbar
          'class' => 'CWebLogRoute',
          'levels' => 'trace',
          'categories' => 'system.db.*'#只是显示关于数据库信息
        ),
      ),
    ),
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,