Yii Framework Forum: run cron cpanel - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

run cron cpanel Rate Topic: -----

#1 User is offline   frrederico 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-November 11

Posted 29 November 2011 - 04:45 AM

hello,

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();


?>


Can anyone tell me why this happens?

thanks
0

#2 User is offline   zekus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 09-March 10
  • Location:London

Posted 29 November 2011 - 05:52 AM

try this command:
php -i | grep argv


you should see something like this:
register_argc_argv => On => On
_SERVER["argv"] => Array


and btw, which yii version are you using?
0

#3 User is offline   frrederico 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-November 11

Posted 05 December 2011 - 04:29 AM

View Postantonio lorusso, on 29 November 2011 - 05:52 AM, said:

try this command:
php -i | grep argv


you should see something like this:
register_argc_argv => On => On
_SERVER["argv"] => Array


and btw, which yii version are you using?


result of php -i | greo argv
<tr><td class="e">register_argc_argv</td><td class="v">Off</td><td class="v">Off</td></tr>

This option is off.

My version is the last stable.
0

#4 User is offline   frrederico 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-November 11

Posted 05 December 2011 - 04:38 AM

View Postfrrederico, on 05 December 2011 - 04:29 AM, said:

result of php -i | greo argv
<tr><td class="e">register_argc_argv</td><td class="v">Off</td><td class="v">Off</td></tr>

This option is off.

My version is the last stable.



ok i resolved with php5 -d register_argc_argv=on ....
0

#5 User is offline   ThePaulius 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 126
  • Joined: 17-February 12

Posted 07 March 2013 - 07:19 AM

I also get "This script must be run from the command line"

register_argc_argv is On

user@server [~/public_html/mydomain.co.uk/protected]# php -i | grep argv
register_argc_argv => On => On
_SERVER["argv"] => Array


Frustration central!
0

#6 User is offline   riyazMuhammed 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 13-September 12
  • Location:Bangalore

Posted 18 March 2013 - 01:29 AM

View PostThePaulius, on 07 March 2013 - 07:19 AM, said:

I also get "This script must be run from the command line"

register_argc_argv is On

user@server [~/public_html/mydomain.co.uk/protected]# php -i | grep argv
register_argc_argv => On => On
_SERVER["argv"] => Array


Frustration central!


Hello,
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.
Please help if you have found the solution!!!
0

#7 User is offline   ariostoi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 10-December 12

Posted 09 April 2013 - 03:16 AM

UP!!!!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users