What the message looks like
Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)Common causes
apc.enable_cliis not set to 1 in the CLI configuration (default is 0).php-apcuinstalled only for FPM, not for the CLI version.- occ runs with a different PHP version than the web server, e.g.
phppoints to 8.1 while FPM uses 8.3. - config.php names APCu but the module was never installed.
Check
- Check that the CLI loads the module
php -m | grep -i apcu - Show apc.enable_cli and the CLI's loaded php.ini
php -i | grep -E 'apc.enable_cli|Loaded Configuration File' - Show the configured local cache
sudo -u www-data php /var/www/nextcloud/occ config:system:get memcache.local - Search existing entries in the CLI configuration
grep -r 'apc.enable_cli' /etc/php/*/cli/
Fix
- Add
apc.enable_cli=1to/etc/php/8.3/mods-available/apcu.ini. - Install the missing module:
apt install php8.3-apcu– matching the PHP version in use. - Call occ and cron with the right version, e.g.
php8.3 occandphp8.3 -f cron.php. - No APCu possible? Use
'memcache.local' => '\OC\Memcache\Redis'instead. - Then check with
occ statusthat the message is gone.
FAQ
Do I need to restart PHP-FPM?
Not for the CLI – it reads its config on every call. Only if you reinstall the module for FPM do you need to restart PHP-FPM.
Does this fix the cron job too?
Often, yes. cron.php aborts with the same message, and Nextcloud then reports stale background jobs.