Codeigniter CLI工作在终端,而不是在Cpanel cron [英] Codeigniter CLI working in terminal, not in Cpanel cron

查看:160
本文介绍了Codeigniter CLI工作在终端,而不是在Cpanel cron的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用CodeIgniter设置cron时遇到问题。我已遵循文档并设置测试cron

I have problems setting up a cron using CodeIgniter. I've followed the documentation and set up a test cron

* * * * * php /home/USERN/public_html/spider/index.php tools message

但这不起作用。输出只是index.php默认控制器,而不是工具/消息。当我在服务器上的终端运行它,我得到我期望的结果。有没有什么我做错了,或者我需要改变服务器上的某些东西?

But this doesn't work. The output is just the index.php default controller, and not tools/message. When I run it in the terminal on the server, I get the results that I expect. Is there something I am doing wrong, or do I need to change something on the server?

推荐答案

对于cPanel服务器要让CI使用URI段正确,您必须使用

For cPanel servers, in order to for CI to use the URI segments right, You'll have to use

/usr/local/bin/php

这篇关于Codeigniter CLI工作在终端,而不是在Cpanel cron的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆