Skip to content

Instantly share code, notes, and snippets.

@SimonJThompson
Created August 14, 2018 14:09
Show Gist options
  • Save SimonJThompson/24f7ba14cf2cf2132cf46acde53fa75d to your computer and use it in GitHub Desktop.
Save SimonJThompson/24f7ba14cf2cf2132cf46acde53fa75d to your computer and use it in GitHub Desktop.
Magento 2 File Permission Reset
# Generic file permissions.
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
# relax ./var permissions.
find ./var -type d -exec chmod 777 {} \;
find ./var -type f -exec chmod 777 {} \;
# relax ./generated resets.
find ./generated -type d -exec chmod 777 {} \;
find ./generated -type f -exec chmod 777 {} \;
# relax ./pub permissions
find ./pub -type f -exec chmod 777 {} \;
# tighten config permissions
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
# correct ownership
chown -R USER:GROUP .
# mark bin as executable
chmod u+x bin/magento
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment