Reputation: 953
I have a laravel 5.2 application which is displaying the typical 'Whoops, something went wrong' PDO error when it can't connect to the database (which includes the IP of the DB and the username/password).
In my app.php file I've got:
'debug' => false,
I've also tried clearing my cache on the server to see if it was still stuck on debugging, but that didn't do anything.
Any help with how to stop this would be greatly appreciated.
Upvotes: 4
Views: 5630
Reputation: 3829
You've to set APP_DEBUG=true
inside .env
file and inside config/app.php set 'debug' => env('APP_DEBUG', true)
Upvotes: 0
Reputation: 1
Just restart your server, ctrl+c
on terminal and retype php artisan serve
again.
It works for me.
Upvotes: 0
Reputation: 24035
Unlike in the other answers, messing with php artisan config:cache
and php artisan cache:clear
and config/app.php
did NOT help me.
I'd forgotten that I'd customized my setup in Laravel 5.7.
/resources/views/errors/500.blade.php
you have./app/Exceptions/Handler.php
. I'd forgotten that I'd overridden the prepareResponse
function.Upvotes: 2
Reputation: 171
I had the same problem, but clearing the cache (php artisan cache:clear
) worked for me.
Upvotes: 1
Reputation: 953
I think I've finally got an answer...
Turns out I cached it using
php artisan config:cache
so I cleared it and now it works. I feel like a bit of an idiot after that..
Upvotes: 10
Reputation: 3182
Try this
Go to config directory, edit app.php and on line 16 comment out 'debug' => env('APP_DEBUG', false),
For commenting just add two slashes as below
//'debug' => env('APP_DEBUG', false),
Once you done that, it will now show simple generic error page if an error occurs.
Upvotes: 2