What am I doing wrong.The application may only be invoked from a command line, got "cgi-fcgi"
Code: Select all
/path/to/cmscli.phar -d /path/to/cmsms cache-clear
What am I doing wrong.The application may only be invoked from a command line, got "cgi-fcgi"
Code: Select all
/path/to/cmscli.phar -d /path/to/cmsms cache-clear
Code: Select all
function is_cli()
{
if ( defined('STDIN') )
{
return true;
}
if ( php_sapi_name() === 'cli' )
{
return true;
}
if ( array_key_exists('SHELL', $_ENV) ) {
return true;
}
if ( empty($_SERVER['REMOTE_ADDR']) and !isset($_SERVER['HTTP_USER_AGENT']) and count($_SERVER['argv']) > 0)
{
return true;
}
if ( !array_key_exists('REQUEST_METHOD', $_SERVER) )
{
return true;
}
return false;
}
if(!is_cli() && (strpos($_SERVER['SERVER_ADDR'],'10.10.10.',0) === 0 || $_SERVER['SERVER_NAME'] =='xxxxx')) {
//wrong config
} else {
//correct config
}
Code: Select all
# clear cmsms cache every 5 minutes
*/5 * * * * /usr/bin/php /full_cmscli_path/cmscli -d /full_cmsms_root_path/public cache-clear 2>&1
I tried all sorts of ways to call cmscli: absolute path, relative, ~, cd to directory, as one-liner, or inside a script.sh (with execute permissions). When my call to cmscli was incorrect, cron sent a different error message.Content-type: text/html; charset=UTF-8
The application may only be invoked from a command line, got "cgi-fcgi"
Further I note that you're using cmscli.phar while reading the install instructions (viewtopic.php?f=1&t=77184) it should have been renamed to cmscli (not sure that's relevant).*/5 * * * * /usr/bin/php /full_cmscli_path/cmscli -d /full_cmsms_root_path/public cache-clear 2>&1
Renaming cmscli.phar to cmscli, and even with 777 permissions made no difference./usr/bin/php /home/xxx/bin/cmscli -d /home/xxx/public_html cache-clear 2>&1
Cache will be cleared on the next request
Code: Select all
/usr/local/bin/php /home/xxx/yyy.nl/cmscli -d /home/xxx/yyy.nl/ cache-clear
Code: Select all
/usr/bin/php-cli /home/xxx/bin/cmscli -d /home/xxx/public_html cache-clear