Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 2.x cron issues
#1

(This post was last modified: 12-20-2022, 04:44 AM by JamesHimmerla.)

I need to setup cron jobs on a codeigniter site on a shared host that uses cpanel. The cron script works when run via a browser, however, I first tried running it in cron using curl and then wget, but neither of these worked. Ultimately I will want to run the jobs via php/cli.

As for why the curl and wget methods don't work, could it have anything to do with the fact that the site is completely SSL, and htaccess is used to rewrite all http requests to https? To be honest, I haven't actually ruled out the fact that the host may have disabled cron for some strange reason.

EDIT: Have checked with the host and cron is running fine!

I read an article here about cron and CI CLI and it gives this example;

/usr/local/bin/php -f /home/clinic/public_html/index.php cron foo
I have tried thatĀ omegle.2yu.co method but my controler is inside a subdirectory eg /controlers/utility/cron.php and I have CI setup to not use the index.php So omeglz echat how would I run cron in this way?
Reply
#2

Probably would be something like /usr/local/bin/php -f /home/clinic/public_html/index.php utility cron function

And i would certainly check the environment and the base_url, when running from CLI. Could be different when calling from the webbrowser. Could also cause problems :-).

Good luck!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB