CodeIgniter +命令行+ Cron + Cpanel [英] CodeIgniter + Command Line + Cron + Cpanel
问题描述
解决:
Crap ...为什么总是你想出一些东西,在你终于决定要求帮助!
SOLVED: Crap... why is it always you figure something out right AFTER you finally decided to ask for help!!
如果其他任何人遇到此问题,请尝试从/ usr / local / bin / php而不是/ usr / bin / php运行以获取代码指示器URI段。
If anyone else is having this problem, try running from /usr/local/bin/php instead of /usr/bin/php to get codeigniter to pick up on the URI segments.
问题
我有最新安装的codeigniter,一切似乎都在本地工作。我最近把我的文件放在我的服务器上,除了我的cron命令以外的所有东西都在工作。
I have the latest installation of codeigniter and everything seems to be working fine locally. I recently put my files on my server and everything except my cron command is working.
当我尝试通过cron调用控制器时(如下所示:http://codeigniter.com/user_guide/general/cli.html ),我没有得到控制器。相反,我得到的输出只是我的默认控制器(登录页面)。
When I try to call a controller through cron (as described here: http://codeigniter.com/user_guide/general/cli.html), I am not getting the controller. Instead, the output I get is simply my default controller (login page).
这在本地工作很好,index.php得到调用,因为我收到电子邮件从默认页面输出。
This worked fine locally and the index.php IS getting called because I'm getting emailed the output from the default page.
有人在这里提出了类似的问题: CodeIgniter Cron作业在共享主机上?响应者建议这是一个Cpanel的问题(这是我现在试图使用来设置cron作业),但与我的托管提供商,他们说整个命令正在运行。然而,CI不抓取控制器的URI。我还检查以确保base_url设置正确(这是证明由文件工作正常通过URL调用)。
Someone asked a similar question here: CodeIgniter Cron Job on Shared Hosting? Responders suggested that it was a problem with Cpanel (which is what i'm now trying to use to set up the cron job), but talking to my hosting provider, they said the whole command is being run. Nevertheless, CI isn't grabbing the URI for the controller. I also checked to make sure the base_url is set correctly (which is proven by the file working fine through a URL call).
任何想法?我只是不能找出为什么它不抓住URI当在命令行格式:/ usr / bin / php index.php controller_class方法
Any thoughts? I just can't seem to figure out why it's not grabbing the URI when in command line format: /usr/bin/php index.php controller_class method
推荐答案
这是答案:
使用 / usr / local / bin / php
/ usr / bin / php
以获取代码指示器来获取URI段。
Use /usr/local/bin/php
instead of /usr/bin/php
to get codeigniter to pick up on the URI segments.
这篇关于CodeIgniter +命令行+ Cron + Cpanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!