Resetting File Permissions
This is an old revision of the document!
Here’s how to reset your file and directory permissions if PHP is running through FastCGI, suPHP, or LSAPI:
- find . -type f -exec chmod 644 {} ;
- find . -type d -exec chmod 755 {} ;
- chmod 550 pear
- chmod 550 mage #for magento 1.5+
If PHP is running as a module (DSO), you will need to do this:
- find . -type f -exec chmod 644 {} ;
- find . -type d -exec chmod 755 {} ;
- chmod o+w var var/.htaccess includes includes/config.php app/etc
- chmod 550 pear
- chmod 550 mage #for magento 1.5+
- chmod -R o+w media
If you are running Pre 1.5 you can copy and paste this
- find . -type f -exec chmod 644 {} ;
- find . -type d -exec chmod 755 {} ;
- chmod o+w var var/.htaccess app/etc
- chmod 550 pear
- chmod -R o+w media
The above commands need to be executed from the root directory where Magento is installed.
* note that the wiki software is removing teh backslash before ; seehttp://www.linuxquestions.org/questions/linux-newbie-8/find-missing-argument-to-%60-exec-308111/ for details *
If you do not have access to SSH:
- Download Magento Cleanup Tool
- Unzip magento-cleanup.php to the root directory where Magento is installed.
!!! In Magento Version 1.5. you need to change magento-cleanup.php:
Edit:
chmod("pear", 550);
into:
chmod("lib/PEAR", 550);
[Added by Pedro Machado in 2011/07/05 - www.xvelox.com] I got errors with the SSH option above, so you may need like me to cleanup session and cache folders:
- rm -R var/cache/*
- rm -R var/session/*
And Set to 755 the var folder:
- chmod 755 -R var


