give storage permission ubuntu laravel ubuntu code example
Example 1: linux give permission to folder
sudo chmod -R a+rwx /path/to/folder
Example 2: proper permission webserver laravel
sudo chmod -R 777 path/to/root
sudo chown -R www-data:www-data /path/to/root
sudo usermod -a -G www-data ubuntu
sudo find /path/to/root -type f -exec chmod 644 {} \;
sudo find /path/to/root -type d -exec chmod 755 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Example 3: debian give write permission
sudo chmod -R 757 /var/www
Example 4: laravel file permissions
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache