Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

consigliere's avatar

500 server error on a route.

When I load a certain view( just this one view the others work fine), I get a
500 Internal Server Error

and when I view the debug on chrome - network

the response and preview both just shows

failed to load response data

running php artisan tail also logs no error.

i tried to empty the html in the view i load. still same result.

works fine on local but not on a droplet in Digitalocean.

0 likes
8 replies
bashy's avatar

What does the route do? Have you tested it by just returning a string in routes.php?

JarekTkaczyk's avatar
Level 53

@consigliere Don't know how Digitalocean works internally but it seems like a permissions problem. Clear all the compiled views from storage/framework/views, then hit the route and check if it helps.

consigliere's avatar

@JarekTkaczyk I deleted everything in the storage/framework/views and now all the routes return 500 Internal Server Error.

@bashy I tried it and even creating a new file but same result.

I'm running on nginx and laravel 5.

bashy's avatar

Got storage folder with write permissions for web user?

Is it just that one route? What is it?

consigliere's avatar

Thank you guys. It was permission problem. Chmod 777 -R storage fixed it. Is there a better/safer way set permissions?

alenabdula's avatar

As @bashy mentioned

write permissions for web user

Simply chmod -R 777 <folder> is not the "right way", you're essentially giving everyone who has access to the system all privileges to this folder. Safer way is to add web user, usually www-data, write permissions to the folder. Something like

  • chown -R www-data <folder>, recursively set owner to www-data
  • chmod -R u+w <folder>, recursively add write permissions for the user (www-data)
1 like
shabber's avatar

Hello guys, I got same server error for one route But the problem is solved very easily with simple mistake i have done in it just add csrf token code in the submitted form for laravel 5.1.

Thank you hope it will help someone

Elistair's avatar

Hope it helps someone who might land here , although is too late I had the same case I ended up deleting the controller in my production environment that was causing 500, i then recreated the controller using php artisan make:controller . then i copied the code from the dev environment and paste in production environment

Please or to participate in this conversation.