【发布时间】:2017-03-04 18:56:22
【问题描述】:
我在.env 文件中有APP_DEBUG=true:
APP_ENV=local
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://test.dev
我故意使用了 web.php 路由文件中没有的不正确的 url(例如:test.dev/asdsadsa)。
当路由不存在时,我希望得到一个 laravel 调试错误
Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161:
但是,即使 APP_DEBUG 设置为 true,它也会一直显示 404 错误页面 (views/errors/404.blade.php)。
我尝试过的:
1 - 我什至进行了测试以确保 laravel 可以读取 .env 文件:
Route::get('/', function() {
dd(env('APP_DEBUG'));
});
返回true
2 - php artisan config:cache 没有修复它。
3 - chmod -R 777 storage 没有修复它。
【问题讨论】:
-
可以提供routes.php和Kernel.php吗?
-
您是否尝试过设置 app.php 文件中的值只是为了检查?当其他人出错时,我已经忽略了我的 .env 文件
-
@num8er kopy.io/tcvzN
-
您是说
artisan config:clear吗? -
如果有404错误页面会显示,如果没有会显示
NotFoundHttpException。
标签: php laravel laravel-5 laravel-5.3