Problem
After the update nextcloud script the Nextcloud VM (Ubuntu 22.04, Nextcloud 32.0.9, PHP 8.2) is down, the webinterfaces shows a an HTTP 500 internal server error
When checking /var/log/apache2/error.log you see:
[Sun May 10 20:38:17.007818 2026] [proxy_fcgi:error] [pid 3221266:tid 140432444835008] [client 172.21.42.211:61182] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught OCP\\HintException: [0]: Memcache OC\\Memcache\\Redis not available for local cache (Is the matching PHP module installed and enabled?)\n\n thrown in /var/www/nextcloud/lib/private/Memcache/Factory.php on line 75'When running php -r "var_dump(class_exists('Redis'));" you get a false:
root@nxtcldger031:~#
root@nxtcldger031:~# php -r "var_dump(class_exists('Redis'));"
bool(false)
root@nxtcldger031:~#
root@nxtcldger031:~# php -m | grep redis
root@nxtcldger031:~#
Cause
Nextcloud tried to use Redis for local memcache but PHPs Redis extension (php-redis) isn't installed or enabled (anymore, in my case after the nextcloud update script).
The redis package installed from the Ondrej PPA was built against the ondrej-provided igbinary binary ABI/version. The PECL-installed igbinary (and its version/ABI) didn’t satisfy that dependency, producing undefined symbol errors when loading redis.so.
Temp Solution/Workaround
sudo apt install -y php8.2-dev build-essential pkg-config unzipsudo pecl install igbinaryecho "extension=igbinary.so" | sudo tee /etc/php/8.2/mods-available/igbinary.inisudo phpenmod -v 8.2 -s ALL igbinarysudo pecl uninstall redis || truesudo pecl install redisecho "extension=redis.so" | sudo tee /etc/php/8.2/mods-available/redis.inisudo phpenmod -v 8.2 -s ALL redissudo systemctl restart php8.2-fpmsudo systemctl restart apache2php -r "var_dump(function_exists('igbinary_serialize'));"php -r "var_dump(class_exists('Redis'));"cd /var/www/nextcloudsudo -u www-data php occ maintenance:mode --off
root@nxtcldger031:~#
root@nxtcldger031:~# php -r "var_dump(class_exists('Redis'));"
bool(true)
root@nxtcldger031:~# php -m | grep redis
redis
root@nxtcldger031:~# Solution for picking redis package from the Ondrej PPA
- sudo pecl uninstall igbinary
- sudo rm -f /etc/php/8.2/cli/conf.d/20-redis.ini /etc/php/8.2/fpm/conf.d/20-redis.ini /etc/php/8.2/apache2/conf.d/20-redis.ini
- sudo find /usr/lib/php -name 'igbinary.so' -o -name 'redis.so' -exec ls -l {} \;
- sudo rm -f /usr/lib/php/20220829/igbinary.so /usr/lib/php/20220829/redis.so
- sudo find /usr/lib/php -name 'igbinary.so' -o -name 'redis.so' -exec ls -l {} \;
- sudo apt install php8.2-igbinary php8.2-redis --reinstall
- sudo phpenmod -v 8.2 -s ALL igbinary redis
- sudo systemctl restart php8.2-fpm
- sudo systemctl restart apache2
- php -r "var_dump(function_exists('igbinary_serialize'));"
- php -r "var_dump(class_exists('Redis'));"
root@nxtcldger031:~#
root@nxtcldger031:~# php -r "var_dump(class_exists('Redis'));"
bool(true)
root@nxtcldger031:~# php -m | grep redis
redis
root@nxtcldger031:~#
No comments:
Post a Comment