Welcome Guest, Not a member yet? Register   Sign In
CRON - No URI present madness
#2

[eluser]CroNiX[/eluser]
Its because you are executing the cron job from the local host, not from a URL, which relies on the appropriate $_SERVER variables being set which doesn't happen with cron.

Check this out: http://ellislab.com/forums/viewthread/88635/
It lets you set these variables when being called from a cron job so everything works as though the request came from the net instead of a local cron job. I've used this a lot for pre CI2. Haven't tried with CI 2, so...

One thing you might do is detect if php is being executed via cron, and if so, set some server vars CI needs like
Code:
if (php_sapi_name() == 'cli')
{
  $_SERVER['HTTP_HOST'] = 'www.yourhost.com';
  //set other vars...
}
In your index.php.


Messages In This Thread
CRON - No URI present madness - by El Forum - 02-02-2012, 09:42 AM
CRON - No URI present madness - by El Forum - 02-02-2012, 10:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB