Skip to content

Instantly share code, notes, and snippets.

@shabayekdes
Forked from Daniyal-Javani/permissions
Last active November 29, 2022 12:02
Show Gist options
  • Save shabayekdes/537b3c3b5f236f0d7be926eb99c76e2d to your computer and use it in GitHub Desktop.
Save shabayekdes/537b3c3b5f236f0d7be926eb99c76e2d to your computer and use it in GitHub Desktop.
Set up File Permissions for Laravel

Local Development

sudo chown -R $USER:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Production Development

cd /var/www/html/xxxx

sudo chown -R www-data:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;

sudo chgrp -R www-data $(find -type d -name storage)
sudo chgrp -R www-data $(find -type d -name cache)
sudo chmod -R ug+rwx $(find -type d -name storage)
sudo chmod -R ug+rwx $(find -type d -name cache)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment