Compiler through command line
-
16-10-2019 - |
Question
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?
Solution
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
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange