Nextcloud version (eg, 20.0.5): 25.0.0
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04 (Snap free)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52
PHP version (eg, 7.4): 8.1.2
The issue you are facing:
When I try and run an OCC command, I get this error:
sudo -u www-data php occ -V
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?)
The manual says to run occ as the http user so I ran sudo -u www-data /usr/bin/php /var/www/html/nextcloud/occ
and got:
Could not open input file: /var/www/html/nextcloud/occ
I also tried sudo -u www-data /usr/bin/php8.1 /var/www/html/nextcloud/occ
to the same effect.
I must be missing something here.
Thanks in advance!
Is this the first time you’ve seen this error? (Y/N): It’s been there since I installed nextcloud, and was there on previous installations too.
Update: I found a web app for OCC so I went ahead and installed it.
I was perfectly able to run commands through the interface (which is a terminal-like interface that runs inside of NC). The only issue I had was that I had to edit the .conf file to exit out of maintenance mode.
So I guess the problem of not being able to run OCC commands has been partially solved. Frankly, I’d rather run them in my own terminal, so if anyone has an idea of why this is happening, I’d be happy to hear about it.
EDIT: Turns out the web app isn’t happy about running db:convert-filecache-bigint which is one reason I’m trying to make occ work, in the first place :-/
Yeah, I’m on 8.1, and your suggestion did remove the MemCache APCu error message, but didn’t solve the overall issue of not being able to use occ commands from the command line.
You will need to config memcache for PHP CLI aswell as the one used by your webserver. For example: I am using PHP8.1-FPM but for CLI, the “normal” PHP (PHP8.1) Library is needed. So I has to maintain two different php.ini config files.
OCC runs and executes PHP command Line and not by an application server (like Apache2).