How to reset file permissions and clear the cache on Magento

Most Magento installations will be on a VPS or Dedicated server with access to the command line, via a tool like putty. This is the easiest and fastest way to both clear the cache and reset file permissions in Magento.

Warning: Be careful when using these tools. If you run them on the wrong folder you can Internal Server Error your whole server!

If you don’t have putty access to the server where Magento is installed:

  1. Download the Magento Cleanup Tool from Magento’s website
  2. Unzip the file to your local computer and then using FTP access to your website, upload the file magento-cleanup.php to the root folder where your Magento installation is located.
  3. In a browser type: http://www.yourdomain.com.au/magento-cleanup.php

If your Magento installation is in a subfolder of your website you will need to put this in to the above url as well as appropriate.

The rest of these instructions assume you have command line access to your server.

Reset file permissions

Log into your server using putty. Change to the directory where your Magento installation is located (to make sure you don’t run this command on the wrong folder!)

Run these commands, one at a time:


find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 550 pear

Quick clear of the cache

After following the above commands you will already be in the folder where your Magento installation is located. Then run the following command


rm -rf var/cache/*

Make sure you ahve changed to the right directory first or you could delete mass parts of your Magento installation rendering your whole install useless!

This entry was posted in Ecommerce General and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

* Copy this password:

* Type or paste password here:

1 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>