3 Ways to Disable Magento's Compilation (Including FTP/SFTP/SSH)

Submitted by deeperdata - 1 year ago

Compilation is a funny thing. For the most part, it seems to be officially deprecated: http://magento.stackexchange.com/questions/12996/when-should-i-use-the-magento-compiler If you've ever managed to install an extension or make serious code changes without disabling Magento's compilation, you may have noticed some adverse affects including blank web pages on both the front and back of your instance. Below are 3 ways to disable compilation even if you can't access your admin panel.

// First Option: Via Magento's admin section

Navigate to System then Tools then Compilation page and click on Disable button
Navigate to System then Cache Management screen and use Flush Cache button.

// Second Option: Via FTP or SFTP, by editing the includes/config.php file

Edit includes/config.php around line 28 and uncomment the first line then comment out the second:

define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');

You can also try commenting out both lines if necessary which restores the file to factory state.

// Third Option: Via SSH ("shell")

php -f shell/compiler.php -- disable
php -f shell/compiler.php -- clear

// More regarding SSH

# php -f shell/compiler.php -- state
Compiler Status:          Disabled
Compilation State:        Not Compiled
Collected Files Count:    0
Compiled Scopes Count:    0

// Finally run this
rm -rf var/cache/* var/session/*
affiliate_link
Learn PHP
comments powered by Disqus
Proudly hosted on Digital Ocean