yii2如何开启debug

广告:宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取~~~

yii2如何开启debug

yii2如何开启debug

1、 在web/index.php文件中添加下面两行代码

defined('YII_DEBUG') or define('YII_DEBUG', true);defined('YII_ENV') or define('YII_ENV', 'dev');
登录后复制

2、打开yii config目录下的web.php文件,找到如下配置

if (YII_ENV_DEV) {       // configuration adjustments for 'dev' environment    $config['bootstrap'][] = 'debug';    $config['modules']['debug'] = [        'class' => 'yii\debug\Module',    // uncomment the following to add your IP if you are not connecting from localhost.        'allowedIPs' => ['127.0.0.1', '我的IP'],      ];    $config['bootstrap'][] = 'gii';    $config['modules']['gii'] = [            'class' => 'yii\gii\Module',            // uncomment the following to add your IP if you are not connecting from localhost.        'allowedIPs' => ['127.0.0.1', '我的IP'],    ];}
登录后复制

把自己的IP添加进去即可。

推荐:《YII教程》

以上就是yii2如何开启debug的详细内容,更多请关注9543建站博客其它相关文章!

9543建站博客
一个专注于网站开发、微信开发的技术类纯净博客。
作者头像
admin创始人

肥猫,知名SEO博客站长,14年SEO经验。

上一篇:怎么写thinkphp
下一篇:分享一篇微信开发之数据解密的实例教程

发表评论

关闭广告
关闭广告