Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter CLI working in terminal, not in Cpanel cron

I have problems setting up a cron using CodeIgniter. I've followed the documentation and set up a test cron

* * * * * php /home/USERN/public_html/spider/index.php tools message

But this doesn't work. The output is just the index.php default controller, and not tools/message. When I run it in the terminal on the server, I get the results that I expect. Is there something I am doing wrong, or do I need to change something on the server?

like image 428
iSenne Avatar asked Apr 24 '26 23:04

iSenne


1 Answers

For cPanel servers, in order to for CI to use the URI segments right, You'll have to use

/usr/local/bin/php
like image 153
ahmad Avatar answered Apr 27 '26 11:04

ahmad