php Laravel 5. 调试模式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40691240/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel 5. Debug mode
提问by Svetoslav Dimitrov
I set debug mode to true
in config->app and deployed it on the server:
我将调试模式设置为true
in config->app 并将其部署在服务器上:
'debug' => env('APP_DEBUG', true),
I have following code in Controller to check the mode:
我在控制器中有以下代码来检查模式:
...
$debug = config('app.debug');
var_dump($debug);
$product->save();
Result on local machine:
本地机器上的结果:
C:\xampp\htdocs\MK\app\Http\Controllers\ProductController.php:45:boolean true
C:\xampp\htdocs\MK\app\Http\Controllers\ProductController.php:45:boolean true
Result on the server:
服务器上的结果:
bool(false) Whoops, looks like something went wrong.
bool(false) 哎呀,好像出了点问题。
Why isn't debug mode set on server side?
为什么不在服务器端设置调试模式?
回答by James
This line in your config file, 'debug' => env('APP_DEBUG', true)
, may be the cause of your issue.
配置文件中的这一行'debug' => env('APP_DEBUG', true)
可能是导致问题的原因。
It is saying; set debug
to the value defined in my .env
file, and if there is none then use true
.
它在说;设置debug
为我的.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.
因此,它正在查看APP_DEBUG=false
您的.env
文件,即使您已将第二个参数设置为 true。
Try updating the setting in your .env
file to true.
尝试将.env
文件中的设置更新为 true。
回答by Leoben Osamah
In your case, just go to your .env
file and change "APP_DEBUG=false"
to "APP_DEBUG=true"
在您的情况下,只需转到您的.env
文件并更改"APP_DEBUG=false"
为"APP_DEBUG=true"