【问题标题】:Redis PHP cache "ERR Not permitted"Redis PHP缓存“ERR不允许”
【发布时间】:2013-06-06 23:53:05
【问题描述】:

我正在尝试让Redis front-end cache to Wordpress 工作。我收到这个致命错误:

    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

我有一个正常工作的 Redis 服务器(用它运行其他项目)。出于某种原因,我收到了ERR Not permitted。有任何想法吗?

【问题讨论】:

  • OK - 这是由于 Redis db 受到密码保护 - 我的 php 脚本中没有包含这个细节。 FFR。

标签: php wordpress caching redis phpredis


【解决方案1】:

正如您在评论中所说,问题是未设置密码。对于将来看到此错误的任何人,您希望通过以下方式实例化您的客户端:

my_client = new Predis\Client(array(
            "host" => "some_host",
            "port" => "some_port",
            "password" => "some_pw",
            "database" => "some_db_number"
        )

【讨论】:

    猜你喜欢
    • 2012-11-22
    • 2017-03-16
    • 2021-01-29
    • 1970-01-01
    • 2023-04-04
    • 2019-11-17
    • 1970-01-01
    • 2015-07-30
    • 1970-01-01
    相关资源
    最近更新 更多