Error when adding missing indices in Nextcloud

Error message:

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


Solution:

In the following configuration file
/etc/php/7.3/mods-available/apcu_bc.ini
insert the following

apc.enable_cli=1
apc.shm_size=512M

And then restart the web server:
service apache2 restart