yii2如何访问debug-创新互联
这篇文章主要介绍了yii2如何访问debug,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

1.项目安装debug工具
php composer.phar require --prefer-dist yiisoft/yii2-debug
2.配置web/index.php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');3.配置config/web.php
if(file_exists(__DIR__ . "/web-local.php")) {
$localConfig = require __DIR__ . "/web-local.php";
$config = ArrayHelper::merge($config, $localConfig);
}(相关教程推荐:yii框架)
4.增加web-local.php
[
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
],
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$localConfig['bootstrap'][] = 'debug';
$localConfig['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', '::1'],
'allowedIPs' => ['*'],
];
$localConfig['bootstrap'][] = 'gii';
$localConfig['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'],
];
}
return $localConfig;5.设置runtime目录为可读写
感谢你能够认真阅读完这篇文章,希望小编分享的“yii2如何访问debug”这篇文章对大家有帮助,同时也希望大家多多支持创新互联网站建设公司,,关注创新互联行业资讯频道,更多相关知识等着你来学习!
新闻标题:yii2如何访问debug-创新互联
网页网址:http://www.jxjierui.cn/article/dpjghi.html


咨询
建站咨询
