Home  >  Article  >  PHP Framework  >  How to display debugging information in yii

How to display debugging information in yii

藏色散人
藏色散人Original
2020-07-21 10:31:502846browse

Yii method to display debugging information: first add "defined('YII_DEBUG') or define('YII_DEBUG',true);" in the entry file; then turn on the page display mode; finally configure the database. .

How to display debugging information in yii

yii Display debugging information and database configuration

During program testing we need to check the program running process, SQL Execute statements, etc. At this time, we can enable the debugging mode of YII

Recommended: "yii Tutorial"

Opening method

1. Add entry file

defined('YII_DEBUG') or define('YII_DEBUG',true);

2. Add

'log'=>array(
      'class'=>'CLogRouter',
      'routes'=>array(
    array(
'class'=>'CWebLogRoute', //开启页面显示模式
           ),
     ),
),

3 to the configuration file. Database configuration

'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=yiidemo',//字符串连接
'username' => 'root',//数据库用户名
'password' => '',//数据库密码
'charset' => 'utf8',//数据库编码
'tablePrefix'=>'yii_'//数据库前缀
),

The above is the detailed content of How to display debugging information in yii. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn