disable magento compiler

Sometimes it is needed to urgently disable and clear Magento compiler, e.g. after installation or some 3rd party Magento module.

If you have active Magento compiler, it is always recommended to disable it before any module installation. You can easy to do it in Magento administrator panel, but what if you installed module by mistake, when compiler was active? Most likely your Magento admin panel will be not accessible.

Fortunately there is a way to clear and disable Magento compiler using command shell.

Login to your server via SSH, change directory to [Folder of your Magento]\shell and execute these commands:

php -f compiler.php clear
php -f compiler.php disable

Clear Magento cache directory (/var/cache), and try to login to Magento admin panel.

If everything is Ok, you can activate Magento compiler back using System -> Tools -> Compiler page.

If you don't have SSH access to your server, you can do the same actions using exec() PHP function. All you need to create special PHP script, upload it to your server via FTP and execute it in your browser.

Here is an example of commands for such PHP file:

echo exec('./shell/php -f compiler.php clear');
echo exec('./shell/php -f compiler.php disable');