[eluser]Unknown[/eluser]
I have been trying now for weeks, on and off, to get my cron jobs working in codeigniter. I have tried the cron bootstrapper, the CLI.php method, and another method.
None of these seem to work for me and I don't understand why. The closest I get is with the CLI.php method (below)
Code:
if (isset($_SERVER['REMOTE_ADDR'])) {
die('Command Line Only!');
}
set_time_limit(0);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'] = $argv[1];
$_SERVER['SCRIPT_NAME'] = 'cli.php';
require dirname(__FILE__) . '/index.php';
I added the SCRIPT_NAME line as it was giving me an error that SCRIPT_NAME was undefined. The result I get from running:
Code:
/usr/bin/php5 /home/sites/mysite.co.uk/public_html/cli.php "test/cron"
Is all of the HTML of my homepage, I do not understand why??
If it makes a difference I am with heart internet, I get the error 'Failed to test the script', but when I check the response in firebug it is my homepage HTML.
I have literally tried everything, I have ran google dry with this topic and am completely stuck. I really hope someone can help me as I am going crazy!!
Thanks in advance!