我正在尝试获取 Redis front-end cache to Wordpress去工作。我收到这个 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
我有一个正常运行的 Redis 服务器(用它运行其他项目)。出于某种原因,我收到了 ERR Not permitted
。有任何想法吗?
最佳答案
正如您在评论中所说,问题是未设置密码。对于将来看到此错误的任何人,您都希望通过以下方式实例化您的客户端:
my_client = new Predis\Client(array(
"host" => "some_host",
"port" => "some_port",
"password" => "some_pw",
"database" => "some_db_number"
)
关于php - Redis PHP 缓存 "ERR Not permitted",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16974101/