Laravel 5.调试模式 [英] Laravel 5. Debug mode
问题描述
我在config-> app中将调试模式设置为 true
并将其部署在服务器上:
I set debug mode to true
in config->app and deployed it on the server:
'debug' => env('APP_DEBUG', true),
我在Controller中有以下代码来检查模式:
I have following code in Controller to check the mode:
...
$debug = config('app.debug');
var_dump($debug);
$product->save();
本地计算机上的结果:
C:xampp\htdocs\MK\app\Http\Controllers\ProductController.php:45:布尔值
true
C:\xampp\htdocs\MK\app\Http\Controllers\ProductController.php:45:boolean true
服务器上的结果:
bool(false)糟糕,看起来好像发生了什么错误。
bool(false) Whoops, looks like something went wrong.
为什么不在服务器端设置调试模式?
Why isn't debug mode set on server side?
推荐答案
此行在您的配置文件中,'debug'=> env(‘APP_DEBUG’,是的)
,可能是造成问题的原因。
This line in your config file, 'debug' => env('APP_DEBUG', true)
, may be the cause of your issue.
将 debug
设置为我的 .env
文件中定义的值,如果没有,则使用 true
。
It is saying; set debug
to the value defined in my .env
file, and if there is none then use true
.
正因如此,它正在您的<中查看 APP_DEBUG = false
code> .env 文件,即使您将第二个参数设置为true。
As such it is looking at APP_DEBUG=false
in your .env
file, even though you have set the second parameter to true.
尝试更新<$中的设置c $ c> .env 文件更改为true。
Try updating the setting in your .env
file to true.
这篇关于Laravel 5.调试模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!