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

hepabolu's avatar

switching env to production causes HTTP 500

I've built my first Laravel appication locally (Laravel 5.6) and the basic functionality works. So I decided to put a beta version on a Digital Ocean server for others to look at.

Here's what I did:

  • droplet = ubuntu 16.04 1-click app with LEMP stack
  • php 7.2 fpm
  • letsencrypt cert installed so everything runs at https
  • rsync copy the entire local directory (so I also have my resources etc.)
  • local dump of database imported on the server

With 'APP_ENV=local, APP_DEBUG=false' everything at the server works as expected. I've clicked around and all pages seem to load fine.

I then switched the APP_ENV to 'production' and suddenly a page that worked before now throws an HTTP 500.

I can't find any logging that can give more information so I'm lost as to what to do.

Questions:

  • what could be wrong?
  • where can I find more logging so I can troubleshoot this?
  • where do I configure more logging if there is no logging configured?
0 likes
1 reply
hepabolu's avatar

Well, after some digging around I decided to remove everything under 'vendor' and 'bootstrap/cache' and run 'composer install --no-dev' again.

rm -rf vendor/*
rm bootstrap/cache/*
composer install --no-dev

Then I ran some of the artisan statements to clear caches:

php artisan cache:clear
php artisan view:clear
php artisan config:cache

and now it works.

Please or to participate in this conversation.