laravel

File and Folder permission for Laravel

Run these commands on your terminal to set up proper permission for your Laravel project files and folders.

sudo find /path/to/your/laravel/root/directory -type d -exec chmod 775 {} \;
sudo find /path/to/your/laravel/root/directory -type f -exec chmod 664 {} \;
sudo chown -R my-user:www-data /path/to/your/laravel/root/directory

You will also need to change permission for your storage folder and cache folder inside the bootstrap folder.

cd /path/to/your/laravel/root/directory
sudo chgrp –R www-data storage bootstrap/cache
sudo chmod –R ug+rwx storage bootstrap/cache

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: