my cronjob in nextcloud is not working. By starting it directly over the prompt i got:
php7.1 -f ~/svn/cloud/cron.php
Fatal error: Uncaught Error: Call to a member function getLogger() on null in /homepages/11/d65873472/htdocs/svn/cloud/cron.php:160
Stack trace: #0 {main}
thrown in /homepages/11/d65873472/htdocs/svn/cloud/cron.php on line 160
What is the reason/origin?
The installation is hostet at 1&1 as webspace
Do you need mor informations?
‘logfile’ => ‘<path to your data directory>/nextcloud.log’,
‘loglevel’ => 2,
The line 160 in the cron.php is already an exception, so something else is broken too. Did you start the cronjob by the user that owns the directory? What system is this running on? The path /homepages looks strange.
the system runs under SMP Debian 3.16.59-1~ui80+1 (2018-10-03) x86_64.
Yes I started the cronjob as the same user - I have no other choice.
Since my nexcloud runs at a webhoster contract, the side is hosted together with other under this path ‘homepages/…’
My home directory is located deeper int the tree. /homepages/11/d65873472/htdocs.
The systems php version is php --version PHP 4.4.9 (cgi-fcgi) (built: Nov 7 2018 13:27:00)
I have to call the script explicitly with php7.1 - I don’t if this is a critical point.
I set the loglevel to two, but i dont’t see the log file at the specified path.
The cronjobs didn’t run under a former Version of nc, so I try to figure out why.
But there is one importatnt point: At the mamagement site of my hoster I can define that the domain for nextcloud uses php7.x. But when I access my sites via ssh, there is php 4.4.9 set as default. The question is which on is used by the cron jobs.
Can I force the cronjobs to use a specific php version? I know that I did it by php7.1 cron.php but how are other script called from the cron.php?
Fatal error: Uncaught Error: Call to a member function getLogger() on null in /homepages/11/d65873472/htdocs/svn/cloud/cron.php:160
Stack trace:
#0 {main}
thrown in /homepages/11/d65873472/htdocs/svn/cloud/cron.php on line 160
'
I can enter the command without getting an error message but it has no effect. In the Settings in the nc web Interface is shown that the cron Job was not done.
As Workaround I activated the cronjob via AJAX.
I have the same problem at my installation with Nextcloud v19.0, which is also hosted at 1&1 / IONOS. The solution is to use the php command line interpreter. You have to run it with the following command:
/usr/bin/php7.4-cli -f ~/svn/cloud/cron.php
A german description to use the PHP Command Line Interpreter is to find at the IONOS Help Center.