I have a php script working when ran through a browser https://mywebsite/cron.php but not through ssh.
I'm running php -f /path/to/the/script/cron.php and I receive errors like Fatal error: Uncaught Error: Class 'MYCLASS' not found.
The cron.php contains code like that:
<?php
require_once("fonctions.php");
$var=new MYCLASS();
The fonctions.php :
<?
require_once("MYCLASS.php");
I tried to use cd /path/to/the/wwwroot before php -f ... but that doesn't work.
I also tried chdir(__DIR__) in the cron.php.
Class 'MYCLASS" not foundsuggests that the require worked, but the php file contains no 'MYCLASS' class. Did this really work via browser ?