Sac*_*hin 41 php cron codeigniter
我在我的网站上使用Codeigniter.我必须使用cron job来运行一个控制器功能.我在网站上使用路线.而且我也没有在url中使用index.php.
例如http://my-domain.com/welcome/show,这里welcome是我的控制器,show是该控制器的功能名称.
我用过这样的,
0 * * * * php /home/username/public_html/welcome/show
这是'没有这样的目录'
如何在CPANEL中为上面的url设置cron jon.
谢谢.
uni*_*n80 36
使用:
php index.php welcome show
Run Code Online (Sandbox Code Playgroud)
作为crontab中的命令.例如:
0 * * * * php /home/username/index.php welcome show
Run Code Online (Sandbox Code Playgroud)
来源(版本2.2.0) http://www.codeigniter.com/userguide2/general/cli.html
来源(版本3.*) http://www.codeigniter.com/user_guide/general/cli.html
Sac*_*hin 18
我用过下面的cron
php /full-path-to-cron-file/cron.php /test/index
Run Code Online (Sandbox Code Playgroud)
来源:http://www.asim.pk/2009/05/14/creating-and-installing-crontabs-using-codeigniter/
这适合我.
谢谢大家
Suv*_*ker 11
你可以试试这个:
wget api.example.com/index.php/controller/function
Run Code Online (Sandbox Code Playgroud)
你也可以尝试:
0 * * * * /usr/bin/curl --silent --compressed http://my-domain.com/welcome/show
Run Code Online (Sandbox Code Playgroud)
或者localhost
0 * * * * /usr/bin/curl --silent --compressed http://localhost/welcome/show
Run Code Online (Sandbox Code Playgroud)
我希望这是有帮助的.
| 归档时间: |
|
| 查看次数: |
81184 次 |
| 最近记录: |