Page 1 of 1

APCu cache issues with PHP [SOLVED]

PostPosted: Feb 2nd, '24, 15:51
by xboxboy
Having issues updating my Nextcloud server web app which I installed manually on Mga8, which has since been upgraded to Mga9. Php itself was also upgraded to V.8, which was good, as support for 7 via Nextcloud has stopped.

So to update nextcloud server I have to run a php updater script. I'm coming across two issues, both I can work around but I'd like to sort it out.
First issue, I start the updater script (all as the "apache" user)
Code: Select all
php updater.phar

Which fails due to a memory issue, so to get around that I found this line, and it works
Code: Select all
php -d memory_limit=512M updater.phar

I think this may be a hang over from when I ran this install a decade ago on my Raspberry PI, so there's probably just a php config I need to update for more memory now I'm on a x86 server.

So running that line, the updater gets almost to the end, then fails (second issue):

Code: Select all
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?)


Now "php -m" shows that APCu is installed.

I have been able to complete the update with the following line:
Code: Select all
php --define apc.enable_cli=1 occ upgrade


Which picks up where the updater.phar script ended, and is able to complete the update.

The APCu fault is the main issue, but if I could get some pointers how to fix both, that would be great.
TIA

Re: APCu cache issues with PHP

PostPosted: Feb 2nd, '24, 17:14
by morgano
Feel free to add your wisdom to https://wiki.mageia.org/en/Nextcloud :)

I guess the author of https://wiki.mageia.org/en/Nextcloud_se ... with_NGINX may be able to help.

Re: APCu cache issues with PHP

PostPosted: Feb 2nd, '24, 17:32
by doktor5000
You could also just search for the error, see e.g. the first two hits:
https://help.nextcloud.com/t/occ-wont-r ... pcu/119724
https://github.com/nextcloud/server/issues/27781
which leads to the official documentation:
https://docs.nextcloud.com/server/21/ad ... n.html#id1

Re: APCu cache issues with PHP

PostPosted: Feb 23rd, '24, 16:35
by xboxboy
Thanks doktor, I used some googlefu and got there in the end.
My only warning on the admin page is to do with maintenance/cron jobs: I have attempted that, but I'll let it run for a day or two and recheck.

Re: APCu cache issues with PHP

PostPosted: Feb 23rd, '24, 16:48
by xboxboy
Turns out my cron entry was correct: I just hadn't enabled it in the nextcloud config.php

If it keeps working fine for the next short while, I'll mark as solved.