StenHigh
10/31/2018 - 10:31 AM

permission dir and files for magento 2

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';