Laravel returns 500 internal server and 404 on routes after deploying to Amazon EC2

I like to ask help on how to fix the 500 internal server and 404 when using laravel routes after deploying it to Amazon AWS.

enter image description here

I tried to clear the cache and restarting the apache2 but no luck.

Also I do change the permissions of the folders
enter image description here

I also change the 000-default.conf file
enter image description here

Until now, no luck on my side. Did I miss something or do I need change some configurations? Please let me know and Thanks in Advance!

>Solution :

The main reason is that composer is using your localhost configuration you’ve to reconfigure your laravelapp on your ec2 instance. Try these commands in order:

1. composer dump-autoload

2. PHP artisan config:cache

3. PHP artisan optimize

and then check your laravel application for your ec2 instance.

Leave a Reply