New installation. Cron, script errors

I just installed Nextcloud on my 'nix shared hosting server. I managed get to clear all the warnings. PHP is dialed in, security is good, caching set up. Just a couple of problems remain. I created a cron job in my cpanel (see https://ibb.co/jLnoxG). The output of the command is sent to me by email. At first the result was
{ā€œstatusā€-ā€œsuccessā€}
But as soon as I changed the ā€œBackground Jobsā€ option (in Admin panel) to ā€œCronā€ (which Iā€™m supposed to right?) then the output changed to this:
{ā€œdataā€:{ā€œmessageā€:ā€œBackgroundjobs are using system cron!ā€},ā€œstatusā€:ā€œerrorā€}
Also, since I set cron, Iā€™ve been getting errors in my Nextcloud log. They say:
Error PHP Undefined index: SCRIPT_FILENAME at XXXXXXXX/public_html/cloud/lib/base.php#141
Error PHP Undefined index: SCRIPT_NAME at XXXXXXXXXX/public_html/cloud/lib/private/AppFramework /Http/Request.php#719
What is going on?

base.php, Line 141:
ā€˜SCRIPT_FILENAMEā€™ => $_SERVER[ā€˜SCRIPT_FILENAMEā€™],

Request.php, Line 719:
$scriptName = $this->server[ā€˜SCRIPT_NAMEā€™];

You can try if you have a different php cli-binary that works (especially on hosting servers, they sometimes have different settings):

There was a report on the bug tracker:

1 Like

I changed the cron command from ā€œphp -f /path/cron.phpā€ to " /usr/local/bin/php -f /path/cron.php ".
It seems to have done the trick. Thanks for pointing me in the right direction.

1 Like