Rohan Kumar
Rohan Kumar

Reputation: 40639

HMVC Codeigniter Cron Issue

I am trying to add a controller in cron but it is not working and the default controller(For example, Welcome) is loading every time. I don't want to use curl or wget as both are working but both thows 500 Internal Server Error while running cron script.

I have tried command for cron,

php /home/username/public_html/index.php myfolder/controller method

But it always run default controller.

Upvotes: 1

Views: 374

Answers (2)

Rohan Kumar
Rohan Kumar

Reputation: 40639

After a long search, hit and try I found a solution and worked for me, below is the command which is working,

php5 /home/username/public_html/index.php myfolder/controller method

One more solution I found somewhere,

/usr/local/bin/php /home/username/public_html/index.php myfolder/controller method

I don't know why but php5 and /usr/local/bin/php instead of php work as expected or may be just using php will executing older version of php.

Upvotes: 1

Ankush Srivastava
Ankush Srivastava

Reputation: 502

Just set cron URL as follows: www.domain.com/controller/method/argument

use method & argument in url only if required.

Upvotes: 1

Related Questions