Setting cron job using codeigniter Setting cron job using codeigniter codeigniter codeigniter

Setting cron job using codeigniter


At first try to run that controller method in CLI mode.In console, go to your project directory an then run your script in CLI mode:

    cd TestProjests/codeigniter    php index.php controller function

If this will work, insert the same line to crontab, but with absolute path:

    php /path_to_your_projects/TestProjests/codeigniter/index.php controller function

This can also help you:https://ellislab.com/codeigniter/user-guide/general/cli.html


The path public_html/TestProject/... is almost certainly a relative path from your user directory. You can use wget in your cron to hit the url:

* * * * * wget http://www.example.com/cronscript > /dev/null

Alter the time above to let it run as much as you like