为什么codeigniter cron不工作

I am trying to set up cronjob in codeIgniter on my localhost so that when I run the same path from terminal it works

This is the Path I have run from the cli(terminal):

/usr/bin/php /home/user_name/path_to_index.php users foo

this works

but when I set this in the crontab file as :

 3 * * * *  /usr/bin/php /home/user_name/path_to_index.php users foo

this is not working.

any idea what is wrong here?

thanks in advance!

Try this

/usr/bin/curl http://examblewebsite/index.php/front/cronjob

front - Controller name

cronjob - function name

in your localhost

0 13 * * * php [application_path]/index.php cli/reminders

if you have more details see this link

If the default method you tried is not working you can make a call through http protocol.

wget http://example.com/example/test/bar/

or

curl http://example.com/example/test/bar/

Reference: http://mildcoder.com/handling-codeigniter-in-cli-and-cron-jobs/