I set up Nextcloud on a new instance of Debian, and thought I had added all the pieces for memory cache and file cache, and had set up cron to run php -f /var/www/html/nextcloud/cron.php
correctly. But in the Administration Overview screen I was still seeing this:
- Last background job execution ran 2 hours ago. Something seems wrong.
- The database is used for transactional file locking. To enhance performance, please configure memcache, if available.
But had installed Redis and APCu and configured them … so what is wrong?
I should mention that I’m using php 8.2. Apparently, with that new version of php, the APCu code now needs an additional setting that wasn’t needed before.
Find your way to /etc/php/8.2/mods-available and edit the apcu.ini file. Add this:
apc.enable_cli=1
Finally! I have the green check mark: All checks passed.
How to test if you cron job is going to run correctly:
sudo -u www-data php -f /var/www/html/nextcloud/cron.php
I had to add the sudo package to Debian, because the basic server build did not come with that. But what it does do, is let me switch user and do the command. First, I specify the same user that Apache is going to use: www-data and then I run the PHP interpreter, using the file /var/www/html/nextcloud/cron.php
Prior to the change, it erred out with a rather ugly OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
Now after the change it simply runs without reporting anything (everything ran sucessful)