Skip to content

Instantly share code, notes, and snippets.

@mgeoffray
Created January 15, 2017 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgeoffray/bcb46235ac9c795115e9854ffae1f366 to your computer and use it in GitHub Desktop.
Save mgeoffray/bcb46235ac9c795115e9854ffae1f366 to your computer and use it in GitHub Desktop.
Magento 2 - Apply default permissions
function m2_apply_permissions() {
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 755 {} \;
find ./pub/media -type d -exec chmod 755 {} \;
find ./pub/static -type f -exec chmod 644 {} \;
find ./pub/static -type d -exec chmod 755 {} \;
chmod 755 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/magento
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment