How To disable the Compiler in Magento?

magento logoYesterday, while working on a Magento project, Everything was fine then, I compiled my Magento install. And, bingoo the admin along with everything stopped working with following error. The payment module of ccAvenues (yeh, I like them or not doesn’t count) took a hit.

Fatal error: Class 'Mage_avenues_Model_Mysql4_Setup' not found in /public_html/domain.com/includes/src/Mage_Core_Model_Resource_Setup.php on line 234

I searched everywhere about How to disable the compiler in Magento and here is what restored my Magento.

You need to edit following code in /magento-root/index.php at around line 43, from this:

/**
 * Compilation includes configuration file
*/
define('MAGENTO_ROOT', getcwd());
$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)){
    include $compilerConfig;
}

to this:

/**
 * Compilation includes configuration file
*/
define('MAGENTO_ROOT', getcwd());
/*
$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)){
    include $compilerConfig;
}
*/

Now, go to your admin. You would be able to login into backend where you can disable or run the compile process as per your requirement. When it’s done you can restore the first version of index.php and everything shall work.

2 thoughts on “How To disable the Compiler in Magento?”

  1. Not working. I did the same thing. Compile the magento store and everything is stopped working now.

Comments are closed.