APP_DEBUG=true 被忽略

I'l*_*ack 7 php laravel laravel-5 laravel-5.3

APP_DEBUG=true我的文件中有.env

APP_ENV=local
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://test.dev
Run Code Online (Sandbox Code Playgroud)

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

我预计当路由不存在时会出现 laravel 调试错误

Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161:
Run Code Online (Sandbox Code Playgroud)

APP_DEBUG然而,即使设置为 true,它仍然显示 404 错误页面 (views/errors/404.blade.php) 。

我尝试过的:

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

Route::get('/', function() { 
  dd(env('APP_DEBUG')); 
});
Run Code Online (Sandbox Code Playgroud)

返回true

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

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

ABD*_*MAN 5

如果有404错误页面views/errors就会显示,如果没有,NotFoundHttpException也会显示。