OCC won't run with memcache/apcu

Use the parameter --define apc.enable_cli=1 for php. e.g.:

sudo -u www-data php --define apc.enable_cli=1  /var/www/nextcloud/occ  maintenance:repair
3 Likes

For me, I was adding apc.enable flag to the wrong php.ini file. The one that should be used is within the cli folder (/etc/php/7.3/cli/php.ini) not the one in fpm folder (/etc/php/7.3/fpm/php.ini).

Also you mistyped apc.enable_cli as apc.enable_cl`.

1 Like

Same error on Nextcloud 21.0.3.
I disabeld apcu in config/config.php.
After Update to Nextcloud 22.0.0 i activated it again and it works.

1 Like

Thanks, this solved my occ acpu issue as well

I put apc.enable_cli=1 in /etc/php/{{ php_version }}/mods-available/apcu.ini and it worked. ({{ php_version }} == 7.4/8.0)

13 Likes

this worked for me, thanks

Thanks to indicate the path /etc/php/{{ php_version }}/mods-available/apcu.ini.
It works for me !

It worked, thank you!

Man, you are my savior. Thx a lot

You made my day. Using the parameter I could finish the update form 21.0.1 to 21.0.4.

It worked! Thank you very much!
On Ubuntu 20.04 apc.enable_cli=1 did not fix occ when in
/etc/php/<version>/php.ini
/etc/php/<version>/fpm/php.ini
/etc/php/<version>/apache/php.ini
/etc/php/<version>/cli/php.ini

Only your suggestion to add it in /etc/php/{{ php_version }}/mods-available/apcu.ini worked!

4 Likes

Hello! I saw your reply and didn’t get to check the other files, but I added it to my instance running on Debian Bullseye with PHP 7.4. Now I’m able to run occ to fix my missing indices :smiley: many thanks

I concurrd this worked for me too. I am completing the last steps of Nextcloud installation to fix below two issues:

  • Your web server is not properly set up to resolve “/.well-known/caldav”. Further information can be found in the documentation :arrow_upper_right:.
  • Your web server is not properly set up to resolve “/.well-known/carddav”. Further information can be found in the documentation :arrow_upper_right:.

And the tutorial that I am following is here:

My system is Ubuntu 20.04 and my PHP version is 7.4

Thanks, this works for me also, but before I need to install sudo apt-get install php7.4-apcu
without this nothing work.

Thank you, this solved my problem (after many days). One note I will add; I had to change the apcu.ini file in both the version 7.4 and 8.1 folders, even though I only have php7.4 enabled. Not sure why but adding the apc.enable_cli=1 line to both apcu.ini files solved the problem

You saved my evening
thanks!

worked for me with php 74
but not for php80

Also had to include

extension = apcu.so

[apc]
apc.shm_size = 512M
apc.enable_cli = 1

in php80/cli/conf.d/user_settings.ini
and made it readable for user http resp. www-data (or better all)

(BTW the flag --define apc.enable_cli=1 never worked for me)

1 Like

Yeaaa the suggestion to add it in /etc/php/{{ php_version }}/mods-available/apcu.ini worked also fine for me :slight_smile:
Thanks guys.

That fixed it for me too. Thanks!