CodeIgniter + 命令行 + Cron + Cpanel [英] CodeIgniter + Command Line + Cron + Cpanel

查看:18
本文介绍了CodeIgniter + 命令行 + Cron + Cpanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已解决:废话……为什么总是在你最终决定寻求帮助后立即想出办法!!

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 运行,让 codeigniter 获取 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 让 codeigniter 获取 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屋!

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