D

Disable Magento Compiler

Disable Magento Compiler is an operation performed before every code change like installation of Magento Connect extensions, Magento upgrade or manual changes in code files.

Magento Compiler is a plain PHP class used to combine PHP class definitions into files under includes/src/ directory. At this time, in most cases this is obsoleted by native PHP opcode caches such as APC, xCache, eAccelerator, Zend Opcache, ionCube Accelerator and so on, you can find the list of opcode caches here. So, if you have opcode cache loaded, do not use Magento Compiler as it is useless and will just cause troubles on every code modification.

To disable Magento Compiler in Backend you can navigate to System > Tools > Compilation:

Disabling Magento Compiler in backend
Disabling Magento Compiler in backend

 

If you can not access backend (due to errors like Class not found in includes/src/__default.php it is still possible to disable Magento Compiler and clear compiled code in shell (via SSH or local shell) by shell/compiler.php CLI utility:

$ php -f shell/compiler.php -- state
Compiler Status:          Enabled
Compilation State:        Compiled
Collected Files Count:    7318
Compiled Scopes Count:    4
$ php -f shell/compiler.php -- disable
Compiler include path disabled
$ php -f shell/compiler.php -- clear
Compilation successfully cleared
$ php -f shell/compiler.php -- state
Compiler Status:          Disabled
Compilation State:        Not Compiled
Collected Files Count:    0
Compiled Scopes Count:    0

If shell/SSH console is not possible in your case, you still can disable Magento compiler via FTP or any FileManager. You just need to move includes/ directory out (renaming or deleting it) and create a new empty includes/ directory with empty includes/config.php file inside if you wish to enable Magento Compiler again some day, otherwise it will complain that can not find that directory.

Disable Magento Compiler
21 votes, 4.83 avg. rating (96% score)
  • Paul Allsopp

    Thank you very much, just saved me a bunch of time :)