Skip to content

Instantly share code, notes, and snippets.

@StenHigh
Last active May 29, 2019 14:55
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 StenHigh/2cf07f8f8797d6569968c5d68721a5b5 to your computer and use it in GitHub Desktop.
Save StenHigh/2cf07f8f8797d6569968c5d68721a5b5 to your computer and use it in GitHub Desktop.
permission dir and files for magento 2
#!/usr/bin/env bash
echo 'start';
echo 'chmod 644';
find . -type f -exec chmod 644 {} \;
echo 'chmod 755';
find . -type d -exec chmod 755 {} \;
echo 'var chmod 777';
find ./var -type d -exec chmod 777 {} \;
echo 'media chmod 777';
find ./pub/media -type d -exec chmod 777 {} \;
echo 'static chmod 777';
find ./pub/static -type d -exec chmod 777 {} \;
echo 'chmod etc 777';
chmod 777 ./app/etc
echo 'etc/*.xml chmod 644';
chmod 644 ./app/etc/*.xml
echo '-R :www-data';
chown -R :www-data .
echo 'chmod u+x bin/magento';
chmod u+x bin/magento
echo 'finish';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment