作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有基本版本。我读了http://www.yiiframework.com/doc-2.0/yii-debug-module.html文章,但我不明白在哪个文件中插入代码,其中包括调试程序?
我搜索了信息,发现在config/web.php中
现在,我在YII_ENV_DEV部分中的debug中编写了这样的代码:
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' => ['85.89.139.124'],
];
$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', '::1'],
];
}
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
最佳答案
检查您的app/web/index.php并确保您拥有
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
........
关于yii2 - 如何在Yii2中启用 Debug模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45087830/
我是一名优秀的程序员,十分优秀!