Compiler is always disabled
-
16-10-2019 - |
Question
I have successfully run the compilation process, but when trying to enable the compilation mode, either through admin panel or through command line, I get no errors, but the state remains always disabled.
The folder includes
has permissions 0775, and the file includes/config.php
has 0777, so I don't think it's a permission issue.
Here is a typical sequence in putty:
myuser@serv01 [~]# php -cli public_html/shell/compiler.php disable
Content-type: text/html
Compiler include path disabled
myuser@serv01 [~]# php -cli public_html/shell/compiler.php enable
Content-type: text/html
Compiler include path enabled
myuser@serv01 [~]# php -cli public_html/shell/compiler.php state
Content-type: text/html
Compiler Status: Disabled
Compilation State: Compiled
Collected Files Count: 7605
Compiled Scopes Count: 4
UPDATE
Even changing the working directory didn't help:
myuser@serv01 [~]# cd public_html/shell
myuser@serv01 [~/public_html/shell]# php -cli compiler.php enable
etc...
UPDATE 2
The file includes/config.php
is always empty, but the folder includes/src
is updated / recreated during compilation.
Solution
You've lost your valid config.php
file. The admin essentially comments out a line in that file to disable the use of the compiler (unless things have changed). Try pulling a clean includes/config.php
from a clean Magento code base and then try enabling it again.
OTHER TIPS
Default contents of config.php
file:
<?php
#define('COMPILER_INCLUDE_PATH', dirname (__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');