Home » Php » php – Laravel 5. Debug mode

php – Laravel 5. Debug mode

Posted by: admin July 12, 2020 Leave a comment

Questions:

I set debug mode to true in config->app and deployed it on the server:

'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

Result on the server:

bool(false) Whoops, looks like something went wrong.

Why isn’t debug mode set on server side?

How to&Answers:

This line in your config file, 'debug' => env('APP_DEBUG', true), may be the cause of your issue.

It is saying; set debug to the value defined in my .env file, and if there is none then use true.

As such it is looking at APP_DEBUG=false in your .env file, even though you have set the second parameter to true.

Try updating the setting in your .env file to true.

Answer:

In your case, just go to your .env file and change "APP_DEBUG=false" to "APP_DEBUG=true"

Answer:

You can also change the setting into your .env file from

APP_ENV=production
APP_DEBUG=false

to

APP_ENV=local
APP_DEBUG=true