Nextcloud version: 22.1.1
Operating system and version: CENTOS 7.9 with cPanel v98.0.7
Apache or nginx version: Apache/2.4.48 (cPanel)
PHP version: 7.4
The issue you are facing:
I’ve tried configuring Redis with NextCloud on a fresh install using the network interface and the Unix socket and neither of them have worked for me.
When I try to use Redis using the network interface (localhost or 127.0.0.1) on my config.php, I still get the “No memory cache has been configured” warning in my admin overview page.
I can confirm that Redis is installed and seems to be working fine:
root@server [~]# redis-cli
127.0.0.1:6379> ping
PONG
I can also confirm the Redis PHP extension is installed:
root@server [~]# php -m | grep redis
redis
This is the code I have added to my config.php:
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
'host' => 'localhost',
'port' => 6379,
],
It doesn’t seem to work. I still get the “No memory cache has been configured” warning in my admin overview page. I’ve also tried replacing ‘localhost’ with ‘127.0.0.1’ and also my server’s IP address, both to no avail. Worse still is that there are no errors I can see in my NextCloud log.
When I set my config.php to use the Unix socket instead, I did do the prerequisites of setting my port to 0 and uncommenting the unixsocket and unixsocketperm lines, and setting the unixsocketperm to 770 specifically in my redis.conf file:
port 0
unixsocket /var/run/redis/redis.sock
unixsocketperm 770
I also added the Apache user www-data (in my OS it’s just called “apache”) to the Redis group:
root@server [~]# sudo usermod -a -G redis apache
root@server [~]# sudo -u apache redis-cli -s /var/run/redis/redis.sock
redis /var/run/redis/redis.sock> ping
PONG
Then I added this code to my config.php:
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
'host' => '/var/run/redis/redis.sock',
'port' => 0,
],
Then I do a full server restart.
Still no dice, and this time, I get an error when opening my NextCloud page:
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
When, removing the lines I added in my config.php, NextCloud does work again though and fortunately, this time, there are errors in the log:
Can anyone tell me what this means? I found a thread where someone was facing a similar issue, except in their case, it turned out to be a SELinux issue, but unfortunately in my server SELinux is turned off entirely:
Cannot get Redis with Unix socket to work on Centos 8 Stream - Support - Nextcloud community
Hopefully that may give a clue but at this point, I have no idea, and I’m new to using Redis. This is a fresh install, and besides the changes I have stated above, all the other settings for my config.php and redis.conf are the default ones.