HTTP Error 500 after trying to activate redis caching

Nextcloud version (eg, 12.0.2): 11.0.2
Operating system and version (eg, Ubuntu 17.04): Debian Wheezy
Apache or nginx version (eg, Apache 2.4.25): nginx 1.6.2-5+deb8u5
PHP version (eg, 7.1): PHP 5.6.33-0+deb8u1

The issue you are facing:
I tried installing redis for caching but failed. I installed Redis and the php5-redis module:

# redis-cli ping
# php -r "if (new Redis() == true){ echo \"OK \r\n\"; }"

But after the restart of nginx I only geht HTTP 500 errors :frowning: also occ is failing, because it cannot find redis:

# sudo -u www-data php occ
PHP Fatal error:  Call to undefined method Redis::isAvailable() in /media/c0599e18-c12b-4941-a6df-9bf25488271f/nginx/nextcloud/lib/private/Memcache/Factory.php on line 86

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. install Redis
  2. install php5-redis (2.2.6)
  3. activate Redis caching in config.php

The output of your Nextcloud log in Admin > Logging:

Not available because the server won't start up.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

the config.php:

$CONFIG = array (
  'instanceid' => 'omit',
  'passwordsalt' => 'omit',
  'secret' => 'omit/omit',
  'trusted_domains' =>
  array (
    0 => 'omit',
  'datadirectory' => '/media/c0599e18-c12b-4941-a6df-9bf25488271f/nginx/nextcloud/data',
  'overwrite.cli.url' => 'omit',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'omit',
  'logtimezone' => 'CET',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => 2,
  'installed' => true,
  'maintenance' => false,
  'memcache.locking' => 'Redis',
  'memcache.local' => 'Redis',
  'redis' => array(
     'host' => 'localhost',
     'port' => 6379,

The output of your Apache/nginx/system log in /var/log/____:

2018/03/11 15:02:30 [error] 7581#0: *182 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to undefined method Redis::isAvailable() in /media/c0599e18-c12b-4941-a6df-9bf25488271f/nginx/nextcloud/lib/private/Memcache/Factory.php on line 86" while reading response header from upstream, client:, server: localhost, request: "GET /status.php HTTP/1.1", upstream: "fastcgi://", host: "omit"

Thank you for helping me in advance :slight_smile:

This is from Nextcloud’s doc.

'memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
 'host' => 'localhost',
 'port' => 6379,

I don’t understand how Redis work but what is the difference between ‘Redis’ and ‘\OC\Memcache\Redis’?

Is there errors in Redis log?

Hi and thanks for your answer.

Yeah I figured this out, it literally means to put the value \OC\Memcache\Redis, I thought it merely depicts the options to choose from -.-

Best regards :slight_smile:

1 Like