fecshop 开启 yii2-debug

技术分享 · Axin · 于 5年前 发布 · 2158 次阅读

yii2-debug

github地址:https://github.com/yiisoft/yii2-debug/blob/master/docs/guide-zh-CN/installation.md

步骤说明

例:开启后台debug

1、保证后台入口文件index.php中调试模式开启

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

2、配置appadmin/config/main-loacl.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', '::1'],
    ];

    $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'],
    ];
}

原配置为

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = 'yii\gii\Module';
}

记升级fecshop 1.6 最新版本

debug 设置了以上配置,yii-debug工具条确还未显示

appserver 入口报错如下 上图报错,是runtime目录下debug没有写入权限。 更改权限还是没有显示

appadmin 入口报错如下

本文由 Axin 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 2 条回复 技术分享
Axin#15年前 0 个赞

我想问下,像appserver这种api接口端,是如何像yii-debug一样来看日志,性能和执行的sql记录的?

好像yii-debug是用不了吧?

Fecmall#25年前 0 个赞

@Axin #1楼 没试过,应该可以的

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics