Created
February 19, 2017 13:35
-
-
Save alihalabyah/e9d5cd077efb4b62cdd40bf4cf75c8ac to your computer and use it in GitHub Desktop.
Magento 2 Reset Directories and Files Permissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -exec chmod 644 {} \; // 644 permission for files | |
find . -type d -exec chmod 755 {} \; // 755 permission for directory | |
find ./var -type d -exec chmod 777 {} \; // 777 permission for var folder | |
find ./pub/media -type d -exec chmod 777 {} \; | |
find ./pub/static -type d -exec chmod 777 {} \; | |
chmod 777 ./app/etc | |
chmod 644 ./app/etc/*.xml | |
chmod -R g+w * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use the
+;
at the end of the command rather than\;
it will process all the files at once rather than one by one.\;
is the same aschmod 644 file1.txt; chmod 644 file2.txt;
and+;
is the same aschmod 644 file1.txt file2.text
.You will see major performance increases.
Edit:
Also, you don't need the final
chmod
command on line 9 and you shouldn't resort to 777 permissions.These will work better: