Using putty, I want to manage compiler mode through command line, but the answer received is always the compiler help:

myuser@serv01 [~]# php public_html/shell/compiler.php state
Content-type: text/html

Usage:  php -f compiler.php -- [options]

state         Show Compilation State
compile       Run Compilation Process
clear         Disable Compiler include path and Remove compiled files
enable        Enable Compiler include path
disable       Disable Compiler include path
help          This help

What am I doing wrong?


This issue related to php configuration. Magento shell script uses $_SERVER['argv'] variables to run particular shell script (see shell/abstract.php). You should enable register_argc_argv setting in php.ini if php is not running in CLI mode.

register_argc_argv = On

ADDITIONAL Create test.php file and add these lines for debugging:

echo php_sapi_name();//this should be printed as "cli"
print_r($_SERVER['argv']);// this should print out arguments

And run the script php -f test.php some extra args

If no results try to run script following: php -cli public_html/shell/compiler.php state

  • Thanks for your answer, I have added that row to a php.ini file in shell folder. Unfortunately this doesn't seem to change anything.
    – perissf
    Jan 11 '14 at 8:23
  • @perissf don't add this line, search for this line and change the value, restart apache server and run the script like php -f public_html/shell/compiler.php state
    – mageUz
    Jan 11 '14 at 8:29
  • It works with php -cli option
    – perissf
    Jan 11 '14 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.