(07-15-2015, 10:19 PM)Wouter60 Wrote: I would like to run a cronjob on my website.
My application is in a folder called app1
So to refer to my index.php, the path is ./app1/index.php
My controller for cronjobs is Cronjobs.php, which is in the application/controllers folder of CI.
In my controller, there is a method called cleanup.
The command for the cronjob is this:
Code:
/bin/php ./app1/index.php cronjobs cleanup
According to CI's documentation about CLI, this is the correct format.
However, it is only executing the index.php. The e-mail that my hosting provider sends to my admin address, contains all html code of the home page, including a lot of php errors.
What am I doing wrong?
With cron on many hosts you should consider using an absolute path to index.php. On many hosts that ends up being something like:
Code:
/home/<youraccount>/public_html/index.php
Everything else you are doing seems fine. What kind of errors do you see in that email?