iamthestreets
iamthestreets

Reputation: 773

PHP Cron Job from cPanel not working

I am using Codeigniter 3 and using the cPanel to run a Cron Job.

I have entered the command like this: php /home/name/public_html/ convert

When loading the page for my controllers I do not need to include index.php so I did not include it in my path above. convert is the name of my controller.

I receive a 404 Not Found when using the above command. If I change it to:

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

I recieve this error:

<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>

I am not sure what I am doing wrong. Does anyone see anything wrong with what I am doing?

Upvotes: 2

Views: 313

Answers (1)

Jeremy Jackson
Jeremy Jackson

Reputation: 2257

I've had to resort to just running

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

Upvotes: 2

Related Questions