thinkphp6开启Trace调试模式

编辑 composer.json 文件:

在 require-dev 里面加上: "topthink/think-trace":"^1.0"

    "require-dev": {
        "symfony/var-dumper": "^4.2",
        "topthink/think-trace":"^1.0"
    },

然后 执行 composer update 进行更新。

若是上面已经有了,请忽略上面的步骤

2. 修改配置:

修改 .env 文件,修改环境变量 APP_DEBUG:

APP_DEBUG = true
APP_TRACE = true

如图

一旦关闭调试模式,发生错误后不会提示具体的错误信息,如果你仍然希望看到具体的错误信息,那么可以在app.php文件中如下设置:

// 显示错误信息
'show_error_msg'        =>  true,    

 效果如图:

猜你喜欢

转载自blog.csdn.net/qq_34861341/article/details/126710003