Can't enable APCu on a new install

Nextcloud 30.0.0
Debian 12
php8.2-fpm

Hi !

I am installing my third Nextcloud server and this time I can’t figure out why I am unable to activate memcache.local APCu.

When I perform an OCC command I get this output :

Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

Then the commands don’t work.

config.php :

‘memcache.local’ => ‘\OC\Memcache\APCu’,

I have installed php-apcu and did phpenmod apcu.

I have added apc.enabled_cli=1 in the file /etc/php/8.2/cli/php.ini (and in the fpm/php.ini just in case).

php -m shows apcu.

I have restarted everything.

I don’t remember struggling about that last times I installed Nextcloud. Could someone help me to know where to look please ?

Thank you very much.

It seems that you are not aware that PHP consists of two different parts, a web server module (WEB) and a command line version (CLI). You need to make sure that the missing module ist installed for both components, If you execute “php -m” you are using the CLI command which doesn’t provide information about the WEB component.

Hi ! Thanks for your answer !

Yes it s true that I’m not very ease with all those php.ini’s and modules and all lol, but I hope getting use to it ! In my dreams all the php confs will be in only one directory lol.

I have the file /etc/php/8.2/apache2/php.ini but in my others servers I didn’t edit it.

I have the file /etc/php/8.2/apache2/conf.d/20-apcu.ini existing.

When I add extension=apcu.so and apc.enabled=1 in CLI or FPM php.ini, OCC commands say this :

PHP Warning: Module “apcu” is already loaded in Unknown on line 0

So I assume I don’t need to add manually these directives.

Somehow the APCu is enabled, but still I get this error when doing OCC command :

Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

That is why I’m so confused.

Finally I have added apc.enable_cli=1 in the file /etc/php/8.2/cli/conf.d/20-apcu.ini and now I don’t have the error and can perform OCC commands.

Now I see that I have in deed added the line on my other servers too.

I won’t forget to note it in my doc now.

Bests.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.