Closed 10029759 closed 4 months ago
I've also tried ...
require_once __DIR__.'/vendor/peppeocchi/php-cron-scheduler/src/GO/Scheduler.php';
This still produces the same error.
Ok, I have managed to fix the issue. I remove the pacage via composer then required it back in. I'm guessing that it wasn't in my compsoser lock file correctly.
This is my working example code that runs as expected on local host
require_once __DIR__.'/vendor/autoload.php';
use GO\Scheduler;
$scheduler = new Scheduler();
$scheduler->php(__DIR__.'/cron/wonde/job.php')->everyMinute();
But when I run this on a Linix Server directly in the terminal.... like this
/usr/bin/php /var/www/absolute-education/public_html/cron-scheduler.php
Then it throws an error...
`PHP Fatal error: Uncaught Error: Class "GO\Scheduler" not found in /var/www/absolute-education/public_html/cron-scheduler.php:8 Stack trace:
0 {main}
thrown in /var/www/absolute-education/public_html/cron-scheduler.php on line 8`
Any thoughts why this is happening?
I'm logged into the server as the website administrator, so have the correct permissions to read, write files.