Home > Article > PHP Framework > How to display debugging information in yii
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. .
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!