NextCloud: Manual configuration for PreviewGenerator

Dear all,

I’m running a YNH on Debian Bullseye in a VPS. The PHP version for NextCloud seems to be v8.1:

ls /etc/php/8.1/fpm/pool.d/
nextcloud.conf  www.conf

I would like to set specific values for the PreviewGenerator plugin and have looked into older posts dealing with manual configuration changes - but somehow I can’t seem to adapt the correct syntax :roll_eyes:

When I ssh onto the server as the user that has admin permissions and try
[MYADMINUSER]@[MYSERVER]:~$ sudo -u nextcloud php /var/www/html/nextcloud/occ config:app:set --value="256 384 1024" previewgenerator widthSizes

there seems to be a lack of privileges:
Sorry, user [MYADMINUSER] is not allowed to execute '/usr/bin/php /var/www/html/nextcloud/occ config:app:set --value=256 384 1024 previewgenerator widthSizes' as nextcloud on [MYSERVER]

There are some posts that execute the commands in a sudo-environment & specify the php version, but that doesn’t seem to work for me either:
root@[MYSERVER]:/var/www/nextcloud# sudo -u nextcloud php8.1 occ config:app:set --value="256 384 1024" previewgenerator widthSizes

leads to

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?)

What am I doing wrong here?

Thanks in advance :partying_face:


You must run with root user and use this command:

sudo -u nextcloud php8.1 --define apc.enable_cli=1 occ config:app:set --value="256 384 1024" previewgenerator widthSizes

or use your command after add it in the php.ini file for a permanent usage:

echo apc.enable_cli=1 >> /etc/php/8.1/cli/php.ini

More explications in this topic (in french)

1 Like

Hi @metyun,
Thank you for providing both a solution and some context :smiling_face_with_three_hearts:

Oh, thanks, that solved a similar problem I had with Memories (“MemCache not available”) !