Run cron job in CodeIgniter and Hostgator Run cron job in CodeIgniter and Hostgator codeigniter codeigniter

Run cron job in CodeIgniter and Hostgator


my answer comes a long time after, but it could help other people.This error is apparently well known, but there is only a quick fix for it : http://ellislab.com/forums/viewthread/227672/It says that it happens when you autoload session library, it calls CI_Input::ip_address() which is not initialized or something like that. The quick fix is in the input class (core/Input.php Line 351 (CI 2.1.2)) :

$this->ip_address = $_SERVER['REMOTE_ADDR'];

become :

if(isset($_SERVER['REMOTE_ADDR']))   $this->ip_address = $_SERVER['REMOTE_ADDR'];else   $this->ip_address = '0.0.0.0';

Hope this helps.


have you setup the correct route in config/routes.php? Try running the script from your browser (or commenting out the execution part) to make sure it's accessible with your current route/htaccess setup.


Check to see if Hostgator is running Apache as Fast-CGI instead of module. If that is the case, the run path to PHP may be different from what you are using.

You might see the relevant information if you check phpinfo.