cronjob in codeigniter using cpanel

巧了我就是萌 提交于 2019-12-04 05:34:50

You can use wget and set the time for whatever you like:

wget http://www.mysite.com/admin/sendDailyEmail

You can also use curl:

curl --silent http://www.mysite.com/admin/sendDailyEmail

For CodeIgniter 2.2.0

You can try this:

 php-cli /home/username/public_html/index.php controller method

or at your case

 php-cli /home/username/public_html/index.php admin sendDailyEmail 

It works fine with me.. Cheers!

jmadsen

Codeigniter sets up command line differently for running crons, etc.

Read: http://www.codeigniter.com/user_guide/general/cli.html

So you should run:

php index.php admin admin sendDailyEmail

(that may need adjusted; based on your code above)

Have a look at an article I just wrote that goes a little deeper into it all:

http://codebyjeff.com/blog/2013/10/setting-environment-vars-for-codeigniter-commandline

i have facing same issue while, but following work for me

wget http://www.yoursite.com/controller/function
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!