OCC won't run with memcache/apcu

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!

Yessss!!!
This worked for me as well.
Thanks guys.

I have the same error

sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/nextcloud/occ maintenance:repair
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

  • system : PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
    NAME=“Debian GNU/Linux”
    VERSION_ID=“11”
  • php8.1
  • nginx

I also tried this option apc.enable_cli = 1 in php.ini but without result

You can find out if it is installed with

dpkg -l | awk '/^ii/ {print $2}' | grep -i php.*apcu

if that gives no echo, then install it:

sudo apt-get install php8.1-apcu

dpkg -l | awk ‘/^ii/ {print $2}’ | grep -i php.*apcu
php8.1-apcu

php8.1-apcu is already the newest version (5.1.22+4.0.11-2+0~20230415.35+debian11~1.gbp2b07cb).

in which php.ini? There are various ones.

To find out, which php.ini file your php reads:

php -i | grep php.ini

php -i | grep php.ini Configuration File (php.ini) Path => /etc/php/8.1/cli
Loaded Configuration File => /etc/php/8.1/cli/php.ini

I am trying to install php 8.2
maybe it’s a problem in php8.1

good luck.

No its not.
My advice would always be, first to find out the reason why the problem occur before you make more confusion.

1 Like

in php 8.2 it does not support nextcloud
I’m back on php 8.1

sudo -u www-data php /var/www/nextcloud/nextcloud/occ db:add-missing-indices
Check indices of the share table.
Check indices of the filecache table.
Adding additional parent index to the filecache table, this can take some time…
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Check indices of the oc_jobs table.
Check indices of the oc_direct_edit table.
Check indices of the oc_preferences table.
Check indices of the oc_mounts table.

Now it is working
I uninstalled everything I had with php and reinstalled php 8.1 again

There are some errors regarding your setup.

now I ran into other problems

You are way too fast with posting here. The background jobs where not able to execute because of the problem you just solved. Wait untill the next job is executed and try to solve it yourself.

1 Like

ready now it works
everything is perfect
Thank you very much for your help

1 Like

but I don’t have the explanation
because until yesterday everything worked fine
yesterday I updated and encountered this problem

worked fine

I solved it as follow:
edit the file /etc/php/8.1/apache2/conf.d/20-apcu.ini
and added this line:
apc.enable_cli=1
Then restarted apache

2 Likes

This one worked for me