1

I'm trying to get a Redis front-end cache to Wordpress to work. I get this fatal error:

    2013-06-07 01:46:12: (mod_fastcgi.c.2701) FastCGI-stderr: PHP Fatal error:  Uncaught exception 'Predis\ServerException' with message 'ERR operation not permitted' in /home/www/predis/lib/Predis/Client.php:291
    Stack trace:
    #0 /home/www/predis/lib/Predis/Client.php(233): Predis\Client->onResponseError(Object(Predis\Command\HashExists), Object(Predis\ResponseError))
    #1 /home/www/index-with-redis.php(76): Predis\Client->__call('hexists', Array)
    #2 /home/www/index-with-redis.php(76): Predis\Client->hexists('7de22495a3e5275...', '3e3299d491f3bac...')
    #3 {main}
      thrown in /home/www/predis/lib/Predis/Client.php on line 291

I have a functioning Redis-server (running other projects with it). For some reason, I get a ERR Not permitted. Any ideas?

knutole
  • 1,709
  • 2
  • 22
  • 41
  • 1
    OK - this was due to Redis db being password protected - a detail I had not included in my php script. FFR. – knutole Jun 07 '13 at 00:27

1 Answers1

2

Like you said in your comment, the problem is the password not set. For anyone seeing this error in the future, you want to instantiate your client with:

my_client = new Predis\Client(array(
            "host" => "some_host",
            "port" => "some_port",
            "password" => "some_pw",
            "database" => "some_db_number"
        )
Eli
  • 36,793
  • 40
  • 144
  • 207