The advanced version of yii2 is used here. Configure debug mode for interface access.
Configuration file directory: frontend/config/main-local.php
(Recommended tutorial: yii framework)
Configuration content:
Theif (!YII_ENV_TEST) { // configuration adjustments for 'dev' environment $config['bootstrap'][] = 'debug'; $config['modules']['debug']['class'] = 'yii\debug\Module'; $config['modules']['debug']['allowedIPs'] = ['*', '127.0.0.1', '0.0.0.0']; $config['modules']['debug']['historySize'] = 200; }
allowedIPs field indicates the IP fields that are allowed to be accessed. Then historySize represents the size of the stored debug file.
Enter the address frontend/web/index.php?r=debug
to enter debug mode.
#Click on the tag to enter this request, and then view the sql, cpu occupancy, execution time, etc.
For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!
The above is the detailed content of How to use debug in yii framework. For more information, please follow other related articles on the PHP Chinese website!