gpt4 book ai didi

php - APP_DEBUG=true 被忽略

转载 作者:可可西里 更新时间:2023-11-01 00:56:45 25 4
gpt4 key购买 nike

我在 .env 文件中有 APP_DEBUG=true:

APP_ENV=local
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://test.dev

我故意使用不正确的不正确的 url(例如:test.dev/asdsadsa),它不在 web.php 路由文件中。

当路由不存在时,我预计会得到一个 laravel 调试错误

Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161:

但是,它一直显示 404 错误页面 (views/errors/404.blade.php),即使 APP_DEBUG 设置为 true。

我尝试过的:

1 - 我什至测试过以确保 laravel 可以读取 .env 文件:

Route::get('/', function() { 
dd(env('APP_DEBUG'));
});

返回 true

2 - php artisan config:cache 没有修复它。

3 - chmod -R 777 storage 没有修复它。

最佳答案

如果在 views/errors 中有 404 错误页面,它将被显示,如果没有,将显示 NotFoundHttpException

关于php - APP_DEBUG=true 被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40193995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com