Memory caching php-apcu

Please help to configure the cache memory.
Сonfigured for this guide: Memory caching — Nextcloud latest Administration Manual latest documentation
Installed php-apcu module:

apt-get install php-apcu

intensified:

phpenmod apcu

tweaked the nextclood config file and the module.
Added a string ‘memcache.local’ => ‘\OC\Memcache\APCu’,

vim /var/www/nextcloud/config/config.php

and
apc.enable_cli = 1

vim /etc/php/7.4/mods-available/apcu.ini

After this setting, it gives an error:
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Version nextcloud 21.0
System debian 9
php7.4, php7.4-fpm

sites error.log
[Sat May 01 12:51:29.683766 2021] [proxy_fcgi:error] [pid 11532] [client x.x.xx:56998] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught OC\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)\n\n thrown in /var/www/html/my_site/lib/private/Memcache/Factory.php on line 98’
Code block file with 98 string:
} else {
throw new \OC\HintException(strtr($missingCacheMessage, [
‘{class}’ => $distributedCacheClass, ‘{use}’ => ‘distributed’
]), $missingCacheHint);
}
with respect.

Hi @f112

Is the following line included in the file and is it uncommented?

extension=apcu.so

…oh, and there must be no spaces in “apc.enable_cli = 1”.

Make sure you add it like this…

apc.enable_cli=1
1 Like

@bb77 thanks for the advice.
Yes, extension=apacu.so is enabled. However, apc.enable_cli=1 was with a space … I removed the spaces, made
#phpenmod apcu
#systemctl restart apache2.service
but no result.

did you change anything else on your system, other than installing php-apcu and enabling it? Did everything work before you made these changes?

Wich package did you install exactley? Make sure php7.4-apcu is installed

Can you post your config.php? (please use “Preformated text” (the “</>” symbol) if you do so and remove all sensitive information like passwords, domain names etc…)

@bb77 thank you very much! I tried to install:
apt install php7.4-apcu
And everything turned out!
The question is resolved!

2 Likes