How to fix a Permission denied error in Laravel

When you move or set up Laravel for the first time you may encounter the following error:

ErrorException: Warning: file_put_contents(/home/username/public_html/laravel/app/config/../storage/meta/services.json): failed to open stream: Permission denied

or alternatively if you don’t have the error messages turned on in your Laravel installation you will see a message saying:

“Whoops! Looks like something went wrong!”

cPanel Hosting from WebhostFace

Laravel needs to have access to write to the app/storage directory. You can change that through your Cpanel File manager. Note that the permissions should be 755 for folders and 644 for files.

cPanel file manager change permissions

That should fix this error but in case you need assistance, the WebHostFace Team will be there for you to help you resolve such issues.

was this knowledge base article useful to you