@@ -55,6 +55,19 @@ If you are sure that no update or backup is currently running, you can fix this
5555 exit 1
5656fi
5757
58+ # Change from APCu to Redis for local cache
59+ # https://github.com/nextcloud/vm/pull/2040
60+ if pecl list | grep apcu > /dev/null 2>&1
61+ then
62+ sed -i " /memcache.local/d" " $NCPATH " /config/config.php
63+ if pecl list | grep redis > /dev/null 2>&1
64+ then
65+ nextcloud_occ config:system:set memcache.local --value=' \OC\Memcache\Redis'
66+ else
67+ nextcloud_occ config:system:delete memcache.local
68+ fi
69+ fi
70+
5871# Create a snapshot before doing anything else
5972check_free_space
6073if ! [ -f " $SCRIPTS /nextcloud-startup-script.sh" ] && (does_snapshot_exist " NcVM-startup" \
@@ -324,13 +337,33 @@ then
324337 check_command phpenmod -v ALL redis
325338fi
326339
327- # Upgrade APCu and igbinary
328- # if [ "${CURRENTVERSION%%.*}" -ge "17" ]
329- if [ " ${CURRENTVERSION%% .* } " -ge " 23" ]
340+ # Remove APCu https://github.com/nextcloud/vm/issues/2039
341+ if is_this_installed " php$PHPVER " -dev
342+ then
343+ # Delete PECL APCu
344+ if pecl list | grep -q apcu
345+ then
346+ if ! yes no | pecl uninstall apcu
347+ then
348+ msg_box " APCu PHP module removal failed! Please report this to $ISSUES "
349+ else
350+ print_text_in_color " $IGreen " " APCu PHP module removal OK!"
351+ fi
352+ # Delete everything else
353+ check_command phpdismod -v ALL apcu
354+ rm -f $PHP_MODS_DIR /apcu.ini
355+ sed -i " /extension=apcu.so/d" " $PHP_INI "
356+ sed -i " /APCu/d" " $PHP_INI "
357+ sed -i " /apc./d" " $PHP_INI "
358+ fi
359+ fi
360+
361+ # Upgrade other PECL dependencies
362+ if [ " ${CURRENTVERSION%% .* } " -ge " 17" ]
330363then
331364 if [ -f " $PHP_INI " ]
332365 then
333- print_text_in_color " $ICyan " " Trying to upgrade igbinary, smbclient, and APCu ..."
366+ print_text_in_color " $ICyan " " Trying to upgrade igbinary, and smbclient ..."
334367 if pecl list | grep igbinary > /dev/null 2>&1
335368 then
336369 yes no | pecl upgrade igbinary
@@ -373,35 +406,8 @@ then
373406 sed -i " /extension=smbclient.so/d" " $PHP_INI "
374407 fi
375408 fi
376- if pecl list | grep -q apcu
377- then
378- yes no | pecl upgrade apcu
379- # Remove old igbinary
380- if grep -qFx extension=apcu.so " $PHP_INI "
381- then
382- sed -i " /extension=apcu.so/d" " $PHP_INI "
383- fi
384- # Check if apcu is enabled and create the file if not
385- if [ ! -f $PHP_MODS_DIR /apcu.ini ]
386- then
387- touch $PHP_MODS_DIR /apcu.ini
388- fi
389- # Enable new apcu
390- if ! grep -qFx extension=apcu.so $PHP_MODS_DIR /apcu.ini
391- then
392- echo " # PECL apcu" > $PHP_MODS_DIR /apcu.ini
393- echo " extension=apcu.so" >> $PHP_MODS_DIR /apcu.ini
394- check_command phpenmod -v ALL apcu
395- fi
396- # Fix https://help.nextcloud.com/t/nc-21-manual-update-issues/108693/4?$
397- if ! grep -qFx apc.enable_cli=1 $PHP_MODS_DIR /apcu.ini
398- then
399- echo " apc.enable_cli=1" >> $PHP_MODS_DIR /apcu.ini
400- check_command phpenmod -v ALL apcu
401- fi
402- fi
403409 if pecl list | grep -q inotify
404- then
410+ then
405411 # Remove old inotify
406412 if grep -qFx extension=inotify.so " $PHP_INI "
407413 then
0 commit comments