I have a 500 internal server error when I set memcache.local by redis, but not memcache.locking

I install the latest Nextcloud (29.0.1.1) on ubuntu 23.10 with php-fpm8.2 nginx and mysql redis by default.

And follower those guide to setup nginx:
https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html

I finished to setup nextcloud, then I want to use redis for the memcache.
So I edit the config.php, add memcache.locking and redis-server info to config.php

'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
     'host' => '/var/run/redis/redis.sock',
     'port' => 0,
     'timeout' => 0.0,
      ),

It’s work, not thing wrong.
Then I add a line infront of the memcache.locking

'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
     'host' => '/var/run/redis/redis.sock',
     'port' => 0,
     'timeout' => 0.0,
      ),

But 500 internal server error when I refresh the website.
I checked the nginx access.log and error.log, just return 500.
Checked the nextcloud.log which in the config dir, not any output.

Where can I get the infomation about error, or need some extra configura for redis-server?

Why I did not use APCu to replace redis, because there some bug in php8.2-fpm with APCu.
Bug #2038916 “php8.2-apcu fails with " undefined symbol: php_str…” : Bugs : php-apcu package : Ubuntu (launchpad.net)
I will try to use APCu next time, but not now.

The log would normally be in your data directory. Are you sure you’re looking at the real log? (An internal server error will generate some sort of output within your log - unless it occurs upstream like at your web server or proxy, but that’s not the situation you’re describing).

Anyhow I would run occ config:list system to see what your parsed config looks like. Maybe a typo will turn up.

The log though is what you need to find.

PHP Warning:  PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib/php/20220829/apcu.so (/usr/lib/php/20220829/apcu.so: undefined symbol: php_strlcpy), /usr/lib/php/20220829/apcu.so.so (/usr/lib/php/20220829/apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\Redis not available for local cache (Is the matching PHP module installed and enabled?)

I know the reason: there are not php-redis module.
Then I install php-redis , it’s fixed.

Thank you for your help!

1 Like