0

I am trying to add link of codeigniter in cron jobs, but it is not working..i don't know why..:(

i am using this one:

php -q /home2/abisysco/asuccessclub/main/getFreeC

1 Answers1

0

CodeIgniter use a complex URL rewriting method, so run the php file directly is not a good idea. Try this:

Create a controller to do your cron job:

<?php
class MyCronJob extends CI_Controller {

    public function dojob()
    {
        // Put your business here
    }
}
?>

And then set your cron job like this:

wget –quiet http://domain.com/MyCronJob/dojob
Tony Dinh
  • 6,668
  • 5
  • 39
  • 58
  • Actually i am using codeigniter framework...in there link type is http://domain.com/class/function –  Mar 14 '14 at 10:14
  • and i am using php -q /home2/abisysco/asuccessclub/main/getFreeC main is class name and getFreeC is function name –  Mar 14 '14 at 10:15
  • CodeIgniter use a complex URL rewriting method that cause your php file running wrong. Please use the `wget` one. – Tony Dinh Mar 14 '14 at 10:15