Error running a console application

I’m trying to run a console app with a cron job. By now I’m running it manually to check if it works and it doesn’t.

I have a cron.php file with the following:




defined('YII_DEBUG') or define('YII_DEBUG', true);

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);


$app = Yii::createConsoleApplication($configFile);


And a TestCommand.php file in protected/commands/ folder


class TestCommand extends CConsoleCommand {


    public function run($args)


        mail('', 'Cron job', 'test');



Every time I run "php cron.php" via SSH I get this error:

X-Powered-By: PHP/4.4.9

Content-type: text/html

<br />

<b>Parse error</b>:  syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>/homepages/18/d452741994/htdocs/yii/framework/YiiBase.php</b> on line <b>61</b><br />

Why is it showing an error in YiiBase.php? I’ve never touched that file. The line 61 is the first line from the file that is not a comment. The line is “public static $classMap=array();”.

Any idea about what’s going wrong?


X-Powered-By: PHP/4.4.9

The problem was the PHP version. Looks like the hosting provider is using PHP 4.4.9 as default version.