2

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?

7
  • by the looks of it the script wants server variables - which it wont get when run from the command line. options are preferable- rewrite script or use the option below Commented Jul 20, 2015 at 21:21
  • 1
    I've had to resort to just running curl http://example.com/controller/function Commented Jul 20, 2015 at 22:56
  • @JeremyJackson Can that be done from the cPanel Cron jobs command? Commented Jul 21, 2015 at 12:39
  • @JeremyJackson usig curl worked for me. I am not sure If I should answer my own question or if you want to write that as the answer. Commented Jul 21, 2015 at 20:48
  • Answered :) And can it be done that way? Commented Jul 21, 2015 at 21:00

1 Answer 1

2

I've had to resort to just running

curl http://example.com/controller/function
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.