Shades Posted June 19, 2023 Share Posted June 19, 2023 Hope all is well. I just need the right guidance; I have a Laravel project that works on my offline environment. When I try deploying it on Almalinux 8 (Nginx). There is a lot of errors and there isn't much resource out there on how to fix the issues such as Server Error 500. Now I am thinking, maybe I need to use an easier Linux server that is compatible with Laravel. Anyone have any suggestions? Quote Link to comment Share on other sites More sharing options...
SRB Posted June 20, 2023 Share Posted June 20, 2023 Have you generated the application key? To check, check your .env file and confirm it's set at the top of the file. The constant is APP_KEY. Outside of that, check server error logs - which I don't know the location of off-hand. Quote Link to comment Share on other sites More sharing options...
Shades Posted June 20, 2023 Author Share Posted June 20, 2023 @SRB - Thanks for your time replying to me. Much appreciated it! I have generated the key and still throws an error 500. As for the logs, am I checking the Laravel logs? Nginx logs? Quote Link to comment Share on other sites More sharing options...
SRB Posted June 21, 2023 Share Posted June 21, 2023 (edited) Check Laravel first because logging to the file should be the default, I believe. If nothing is there, then try Nginx logs. Also, I just remembered storage permissions are sometimes wrong, which can be remedied with the following: https://dev.to/alexandrefreire/fix-permissions-errors-from-laravel-2p1f Not sure about your willingness or position to install external SaaS projects for logging errors etc, but at work, we use https://flareapp.io which we hook into a development slack channel, so we know about errors as they happen - that'd also cover these errors. However, at $9 a month, it's not free which some people prefer. Edited June 21, 2023 by SRB Duplicate merged post Quote Link to comment Share on other sites More sharing options...
rockwood Posted June 23, 2023 Share Posted June 23, 2023 (edited) cd /code/laravel_project php artisan cache:clear php artisan config:clear sudo service php8.0-fpm stop sudo service nginx stop sudo chown -R $USER:www-data storage sudo chown -R $USER:www-data bootstrap/cache chmod -R 775 storage chmod -R 755 bootstrap/cache sudo service php8.0-fpm start && sudo service nginx start (i don't know your php's package version ) Edited June 23, 2023 by rockwood Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.