Memcache APCu not available for local cache issue

Nextcloud 24.0.1
Ubuntu 22.04 LTS
Apache2 / MySQL
PHP Version 8.0

Config.php file:

<?php
$CONFIG = array (
  'instanceid' => 'ocqkh37jzrid',
  'passwordsalt' => '27ZqiQEJcutckx4gApE2mgIRc/CEBV',
  'secret' => '0/fD8onLt5mm1YGiB3ZqSrp0AynN8VbqCNaT3nQqilZuBz7M',
  'trusted_domains' =>
  array (
    0 => '10.0.0.32',
    1 => '192.168.1.77',
    2 => 'my.domain.com',
  ),
  'datadirectory' => '/mnt/nxtcld-md0-raid1/data',
  'dbtype' => 'mysql',
  'default_phone_region' => 'US',
  'version' => '24.0.1.1',
  'overwrite.cli.url' => 'https://my.domain.com',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'dbpassword',
  'installed' => true,
  'filelocking.enabled' => true,
  'memcache.local' => '\OC\Memcache\APCu',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
);

I’m trying to restore my files from a previous Nextcloud instance (which has worked before) using this command:

sudo -u www-data php /var/www/nextcloud/occ files:scan --all

However, no matter what solution I implement, I get this error most of the time:

OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

I try to run the following code that many say fixes the problem, but I get all of this in response:

sudo -u www-data php --define apc.enable_cli=1  /var/www/nextcloud/occ  maintenance:repair
An unhandled exception has been thrown:
Error: Call to undefined function simplexml_load_file() in /var/www/nextcloud/lib/private/App/InfoParser.php:69
Stack trace:
#0 /var/www/nextcloud/lib/private/App/AppManager.php(506): OC\App\InfoParser->parse()
#1 /var/www/nextcloud/lib/private/legacy/OC_App.php(595): OC\App\AppManager->getAppInfo()
#2 /var/www/nextcloud/lib/private/AppFramework/App.php(74): OC_App::getAppInfo()
#3 /var/www/nextcloud/lib/private/legacy/OC_App.php(280): OC\AppFramework\App::buildAppNamespace()
#4 /var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php(117): OC_App::registerAutoloading()
#5 /var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php(91): OC\AppFramework\Bootstrap\Coordinator->registerApps()
#6 /var/www/nextcloud/lib/base.php(654): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
#7 /var/www/nextcloud/lib/base.php(1104): OC::init()
#8 /var/www/nextcloud/console.php(48): require_once('...')
#9 /var/www/nextcloud/occ(11): require_once('...')

List of installed PHP modules:

[PHP Modules]
apcu
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

I have php8.0-apcu installed, but maybe I need to install something else…? Ngl, I’m a bit of a novice to server maintenance (especially this), but I’m a moderate Ubuntu user. I’m more than willing to walk through anything I’ve already setup/installed/configured. Any advice or help is greatly appreciated.

Your steps were right and it seems that you have installed all required modules (Installation on Linux — Nextcloud latest Administration Manual latest documentation). Where did you get the modules list from? Via web-interface or from command line?
PHP configurations can differ between command line and web.

The command you are using to rescan the data folder should not be required when Nextcloud works properly. If you access files through the Nextcloud interface and endpoints (via dedicated clients and/or webdav), this should not happen.
And changing files in the data folder directly, shouldn’t be done, use external storage instead (a local folder can be an external folder to Nextcloud).

Sorry, forget about the remark with the update. The post showed up on top and at the time of writing the major version was still supported.