Skip to content

Instantly share code, notes, and snippets.

@kpheasey
Last active October 1, 2015 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpheasey/86bfc4625a236e3fe211 to your computer and use it in GitHub Desktop.
Save kpheasey/86bfc4625a236e3fe211 to your computer and use it in GitHub Desktop.
Magento Permissions
#Set Magento root directory permissions. Call using the following:
# curl -sL https://goo.gl/b1NkHW | sudo bash
#!/bin/bash
if [ ! -f ./app/etc/local.xml ]; then
echo "-- ERROR"
echo "-- This doesn't look like a Magento install. Please make sure"
echo "-- that you are running this from the Magento main doc root dir"
exit
fi
if [ `id -u` != 0 ]; then
echo "-- ERROR"
echo "-- This script should be run as root so that file ownership"
echo "-- changes can be set correctly"
exit
fi
find . -type f \-exec chmod 644 {} \;
find . -type d \-exec chmod 755 {} \;
find ./var -type d \-exec chmod 777 {} \;
find ./var -type f \-exec chmod 666 {} \;
find ./media -type d \-exec chmod 777 {} \;
find ./media -type f \-exec chmod 666 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
# Set Magento root directory permissions. Call using the following:
# curl -sL https://goo.gl/B5xdks | sudo bash
#!/bin/bash
find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 600 {} \;
@philipvas
Copy link

magento connect permissions break magento 1.9 - 403 forbidden access error in apache for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment