If we are installing    3rd party magento module without disableing and clearing magento compiler , we get an error in magento of “mage registry key already exist” or our magento admin panel  get stop working or stop website functionality .

It is always recommended in magento , magento compiler should be disabled before any module installation , if you have active magento compiler.

If your magento admin panel not works for disabled compiler , here I am explaining a way to clear and disable magento compiler using command line or shell prompt and php function .

Magento compiler clear and disable using command line utility

Magento having command line script for communication with the compiler. Now login via SSH and go the website directory or document root  and  we need to run compiler.php file which is in the shell folder in website directory of website  for clearing and disableing the compiler. Execute below commands  as listed.

# php shell/compiler.php clear

# php shell/compiler.php disable

Here you can also check the status  of the compiler.

# php -f shell/compiler.php  -- state

Compiler Status:          Disabled

Compilation State:        Not Compiled

Collected Files Count:    0

Compiled Scopes Count:    0

Now clear the magento cache directory (/var/cache) , Now try to  login to Magento admin panel

Magento compiler clear and disable through php function exec()

if we don’t have SSH access of server , we can do it  through php function exec() . We  need to create a php script for it and upload it on the server via ftp or sftp which you have to execute it in the browser.

Crate a php file and insert  below script  and upload it to the server.

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

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

Magento compiler clear and disable manually :

Here is one more method of disableing compiler mode through configuration file it includes folder named config.php but ideally we should never edit this file by directly .

Find below file in include folder named as config.php . Path will be  as follows.

[Magento root folder]/include/config.php.

Edit the config.php file and comments below both lines :



Now login in admin panel and change the compiler Disable/Enable.


By Sachin G

I am a professional freelance contributor and founder of tech transit. Love to write and lover of education, culture, and community. I have been using it, setting, supporting, and maintaining it since 2009.Linux rocks! Sachin G Follow me on LinkedIn and x formerly twitter