frutality
frutality

Reputation: 356

Laravel 500 error no logs

First of all, according to stackoverflow, this problem occurs when something is wrong with permissions of bootstrap/cache and storage directories. And I tried literally every advice on that with no luck.

I was happy user of Xubuntu 16.04 at my old laptop, developed one project. Using docker-compose to set up development environment. Yesterday I bought brand new PC, installed Kubuntu 18.04, installed docker and everything I need to work.

Cloned repository, ran composer install, docker-compose up, then php artisan migrate and php artisan storage:link. But when I try to open website in browser, I get 500 error with empty body response.

APP_DEBUG is set to true.

6 hours later I'm here with literally zero results. Tried dozens of solutions found here and on forums (just example).

I even did a little experiment: removed project directory from my old laptop, cloned it from scratch, installed everything required and it worked. Without any permission problem.

And what kills me more: there are no logs inside docker containers, no logs inside laravel directory, just nothing.

Please help! What's wrong? Maybe it's Kubuntu? Maybe it's 18.04? Maybe it's newer docker version?

P.S. Right now bootstrap/cache and storage directories are owned by alex:alex and has 775 permissions. Exactly same as at my laptop.

Upvotes: 6

Views: 11330

Answers (3)

Andrew Rivera
Andrew Rivera

Reputation: 1

If you are on linux server it may be selinux permissions. Try setting selinux as passive:

in terminal type:

setenforce 0

then see if you see errors. If it works as should you want to turn selinux back on:

setenforce 1 

Then give directory writable with selinux command:

chcon -R -t httpd_sys_rw_content_t /path  

Upvotes: 0

Nikola Kirincic
Nikola Kirincic

Reputation: 3757

Looks like error is probably either related with storage permissions that should be 777, or with ownershp, or with app's bootstrap, before it even runs your files, when it pulls out configuration setup.

Check the .env configuration, and config files in config directory for any errors.

For storage switch to 777 permissions

chmod -R 777 storage

For configuration issues, try first with

php artisan config:clear

From the console.

Upvotes: 3

Brian Lee
Brian Lee

Reputation: 18187

Add a dd($exception->getMessage()); to the exception handler class right before line 37. Run the request and check the response.

If that doesn't avail anything, verify the request is hitting the webserver by checking access and error logs. Check system logs also using dmesg and similar.

Since you mention Docker, if you're using nginx, be sure your site configuration is not being overwritten when running docker-compose up.

Upvotes: 14

Related Questions