Skip to content

Instantly share code, notes, and snippets.

@mehrdadx10
Last active September 13, 2021 05:58
Show Gist options
  • Select an option

  • Save mehrdadx10/e39d8aabe176b70c3fb12045a1c845a2 to your computer and use it in GitHub Desktop.

Select an option

Save mehrdadx10/e39d8aabe176b70c3fb12045a1c845a2 to your computer and use it in GitHub Desktop.
laravel file permission
# user as owner
sudo usermod -a -G www-data $USER
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
# webserver as owner
sudo usermod -a -G www-data $USER
sudo chown -R www-data:www-data .
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment