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

(11-21-2021, 05:41 AM)kenjis Wrote: It should be /home/my-app/app/Controllers/Test.php.
And its class name should be Test.

And run:
/usr/bin/php /home/my-app/mydonain.co.uk/index.php test >> /home/my-app/app/Controllers/logfile.php


Thank you Kenjis as recommend it tried:

my controller
PHP Code:
<?php namespace App\Controllers;

use 
CodeIgniter\Controller;
use 
CodeIgniter\Database\Query;
use 
App\Controllers\BaseController;

class 
Test extends BaseController {
 
     public function index() {
         echo "I am at jobtracker/app/Controller/Quotes";
         die();
     }
 

My Cron command
/usr/bin/php /home/my-app/mydomain.co.uk/index.php test >> /home/my-app/app/Controllers/logfile.php


Output = Status: 404 Not Found

I believe the issue is the Ci4 app/Controllers folder sits outside of the folder where the domain index.php file sits

app/Controllers sit in            /home/my-app/app/Controllers/ 

domain index.php sits in     /home/my-app/mydomain.co.uk/


I really appreciate you time.
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 - 11-21-2021, 06:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB