来自cPanel的PHP Cron Job无法正常工作

问题描述:

我使用Codeigniter 3并使用cPanel运行Cron Job。来自cPanel的PHP Cron Job无法正常工作

我已经进入命令是这样的: php /home/name/public_html/ convert

当加载了我的控制器,我并不需要包括index.php所以我没有在我的道路包括它上面的页面。 convert是我的控制器的名称。使用上述命令时收到404 Not Found。如果我将其更改为:

php /home/name/public_html/index.php convert

我收到此错误:

<h4>A PHP Error was encountered</h4> 
<p>Severity: Notice</p> 
<p>Message: Undefined index: REQUEST_METHOD</p> 
<p>Filename: core/Security.php</p> 
<p>Line Number: 208</p> 

我不知道我做错了。有没有人看到我在做什么错?

+0

- 它不会在命令行运行时获得。选项是可取的 - 重写脚本或使用下面的选项 – 2015-07-20 21:21:37

+1

我不得不求助于运行'curl http:// example.com/controller/function' –

+0

@JeremyJackson这可以通过cPanel Cron作业命令完成吗? – iamthestreets

我不得不求助于只是它的脚本希望服务器变量看起来运行

curl http://example.com/controller/function