Welcome Guest, Not a member yet? Register   Sign In
Accessing Controller with CRON
#9

Thank you everyone for your input and help, but I found the issue was nothing to do with Codeigniter at all. It is all to do with the setup on the hosting servoice and access the correct php.
Codeigniter requires php CLI and NOT php CGI !!!
When testing, ensure Ci4 is set to development (.env) for more meaningful error reporting.
In my instance I needed to contact the hosting support team to establish the correct php path.
I was using /usr/bin/php home/my-app/mydomain.co.uk/index.php test >> /home/my-app/app/Controllers/logfile.php (where test is the named route to my controller) this was causing the cron to fail becauseĀ /usr/bin/php was using the php CGI engine.
My CLI engine is located at /usr/local/bin/php so by running /usr/local/bin/php home/my-app/mydomain.co.uk/index.php test >> /home/my-app/app/Controllers/logfile.php Cron was able to find the desired controller and run my routine.

I hope this helps.
Reply


Messages In This Thread
Accessing Controller with CRON - by 68thorby68 - 11-17-2021, 10:37 AM
RE: Accessing Controller with CRON - by Secux - 11-17-2021, 02:20 PM
RE: Accessing Controller with CRON - by kenjis - 11-17-2021, 10:18 PM
RE: Accessing Controller with CRON - by kenjis - 11-18-2021, 04:06 PM
RE: Accessing Controller with CRON - by kenjis - 11-21-2021, 05:41 AM
RE: Accessing Controller with CRON - by 68thorby68 - 12-07-2021, 02:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB