I have implement a cron, but the anwser that I receive in my email is:
"This script must be run from the command line."
Cron:
/usr/bin/php -q /home/user/public_html/folder/yiicmd.php test
yiicmd.php file:
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/console.php';
// $globals=dirname(__FILE__).'/protected/globals/globals.php';
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// require_once($globals);
require_once($yii);
Yii::createConsoleApplication($config)->run();
?>
Same issue for me also. I am able to run the command from termainal. However when I add this command in cron tab, i get the emails saying, This script must be run from the command line.