Humhub cron job on Justhost

Hi. I am new to web hosting and website management. I have a website using Humhub social script which is built on top of Yii framework. I recently moved my website from Bluehost shared hosting to Justhost shared hosting.

The website itself is running fine. My cron jobs used to be running on Bluehost but I couldn’t make it run on Justhost. The error log reads:

PHP Notice: Undefined index: SCRIPT_FILENAME in /home2/screenad/public_html/protected/vendors/yii/base/CApplication.php on line 142

Line 142 of mentioned script:


My crontab setting is:

30 * * * * /home2/screenad/public_html/protected/yiic cron hourly >/dev/null 2>&1

I did some research and it is almost obvious that super global variable $_SERVER is not getting populated when it is called from a command line application.

PHP Config page of Justhost has a note:

If you choose to use PHP 5.4, you’ll want to make sure your crons use “/usr/php/54/usr/bin/php” instead, as otherwise it will use PHP 5.2.

I am not sure this has anything to do with the error I am receiving or I don’t know where to place mentioned path in code but I thought it may be related. Does anyone have an idea what might be the problem?

Further info: I replaced $_SERVER[‘SCRIPT_FILENAME’] with hard coded path. Now I don’t get error but still not working. I placed some error_log statements in yiic.php and it seems that this statement fails:

$app=Yii::createApplication(‘HConsoleApplication’, $config);

But I don’t get any other errors. Why might Yii not be able to create console application?

Problem persists. I suspect there is something wrong with console application configuration. Do you see anything wrong with this configuation?



 * Console Default Configuration


 * This configuration file only affects only the console application.


$defaults = require (dirname(__FILE__) . '/_defaults.php');

$pre_config = CMap::mergeArray($defaults, require ($defaults['params']['dynamicConfigFile']));

return CMap::mergeArray($pre_config, array(

            'preload' => array('log'),

            'behaviors' => array(

                'viewRenderer' => 'HConsoleApplicationBehavior',


            'components' => array(

                'request' => array(

                    'class' => 'HHttpRequest',


                'user' => array(

                    'class' => 'ConsoleUser',


                'log' => array(

                    'class' => 'CLogRouter',

                    'routes' => array(


                            'class' => 'CFileLogRoute',

                            'levels' => 'error, warning',





            // autoloading model and component classes

            'import' => array(











            'commandMap' => array(

                'message' => '',

                'search_rebuild' => '',

                'search_optimize' => '',

                'integritychecker' => '',

                'space' => '',

                'emailing' => '',

                'cron' => '',

                'cache' => '',

                'module' => 'application.modules_core.admin.console.ModuleTool',

                'update' => '',

                'migrate' => array(

                    'class' => '',

                    'migrationPath' => 'application.migrations',

                    'migrationTable' => 'migration',




today i had the same error using bluehost, it worked using the following command

30 * * * * php-cli /home2/screenad/public_html/protected/yiic.php cron hourly >/dev/null 2>&1