CH17's avatar
Level 3

Lumen errors not showing

Hello, I'm trying a fresh install with Lumen. Everything is fine except error page showing blank. No messages. Not even "Whoops, looks like something went wrong." .env file debug mode is true.

Please help!!

0 likes
5 replies
sitesense's avatar

Do you have HHVM enabled? I've had problems with HHVM not displaying errors in the past, although I think that might be fixed in recent builds.

rvanhoof's avatar

Make sure your /storage directory is writable for the webserver and the following line is uncommented in /bootstrap/app: Dotenv::load(DIR.'/../');

1 like
DanWilhelmsen's avatar

I ran into this issue today. I was used to Laravel's stack trace display. Unless I mis-configured it, I don't think Lumen has it running by default. The reason I was seeing that page rather than an error was because, even though I set up the .env file, I didn't set the environment when I ran artisan serve. Use the following when running on your local:

php artisan serve -vvv --env local

With that you should be able to see the errors displayed on the page. (The -vvv flag sets the highest verbose level for artisan in the shell. You can leave that off if you like.) In addition, you can also find the error in the error log. Navigate to storage/logs/lumen.log. This should show the error that was thrown to show that page. In my case, I simply forgot to use use Illuminate\Http\Request; when using the request object with dependency injection.

HamsiKafalu's avatar

old post but usefull for others you need to enable your Dotenv from "app/bootstrap.php" and then uncomment Dotenv::load(DIR . '/../');

make sure you have .env file in your root folder and debug set to true

1 like
jjtriff's avatar

The answer given by @rvanhoof was the solution to my case. You can check under which user is the server running with htop for instance and then change the owner of the storage directory:

chown -R www-data storage/

In my case is apache2 web server. Hope this helps.

Last thing I must declare here (also as a reminder for myself) is that I was able to note that problem checking apache logs in /var/log/apache2/error.log:

tail /var/log/apache2/error.log
1 like

Please or to participate in this conversation.