這里采用的是YII2的advanced的版本。配置接口訪問(wèn)的debug模式。?
配置文件目錄:?frontend/config/main-local.php?
(推薦教程:yii框架)
配置內(nèi)容:
if?(!YII_ENV_TEST)?{ ????//?configuration?adjustments?for?'dev'?environment ????$config['bootstrap'][]?=?'debug'; ????$config['modules']['debug']['class']?=?'yiidebugModule'; ????$config['modules']['debug']['allowedIPs']?=?['*',?'127.0.0.1',?'0.0.0.0']; ????$config['modules']['debug']['historySize']?=?200; }
allowedIPs?字段表示允許訪問(wèn)的ip字段。然后historySize 表示存儲(chǔ)的debug文件大小。
輸入地址?frontend/web/index.php?r=debug?來(lái)進(jìn)入debug模式。?
點(diǎn)擊tag能夠進(jìn)入這個(gè)請(qǐng)求里面,然后查看sql,cpu占有率,執(zhí)行時(shí)間等。
更多編程相關(guān)內(nèi)容,請(qǐng)關(guān)注php中文網(wǎng)yii框架欄目!
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
THE END