Blog

Laravel gives error 500 without any further log or information if storage permissions are not allowed

I will start with the fact that I hate Laravel.
But, still a client wanted to me to deal with an application built on it. First it forced me to upgrade PHP from 7.4 to 8.1. Then it kept giving error 500. I tried to add log options to PHP INI, enabled logging in the index.php script itself, but it kept sending error 500 without any further information.

In case anyone gets stuck with this. Please go to the app folder and run this command: chmod -R 777 YOUR_APP_FOLDER_PATH/

This means we are giving all read/write permissions to all processes on the server to that app folder. Next, you can visualise which user:group it should be specifically. For me I am using OpenLiteSpeed so it was nobody:nogroup.

So, I fixed it using this command: chown -R nobody:nogroup YOUR_APP_FOLDER_PATH/
You may also bring back folder permissions to 755 and file permissions to 644 for the app. So, please use these 2 commands.
find YOUR_APP_FOLDER_PATH/ -type d -exec chmod 755 {} \;
find YOUR_APP_FOLDER_PATH/ -type f -exec chmod 644 {} \;

Leave a Reply

Your email address will not be published. Required fields are marked *