找不到保存处理程序 - redis集群

时间:2015-09-29 16:17:58

标签: php redis centos cluster-computing phpredis

我正在使用phpredis(redis_cluster分支)与redis stable(v3.0.4)在CentOS 7.1(最新)和PHP 5.6(remi repo)与Apache(2.4.6)之上

使用具有3个母版的集群(仅测试)。

我的redis.ini包含:

extension = redis.so
session.save_handler = rediscluster
session.save_path = "mycluster[]=192.168.1.100:6379&mycluster[]=192.168.1.100:6380&mycluster[]=192.168.1.100:6381&timeout=3&read_timeout=3&failover=error"
redis.clusters.seeds = "mycluster[]=192.168.1.100:6379&mycluster[]=192.168.1.100:6380&mycluster[]=192.168.1.100:6381"
redis.clusters.timeout = "mycluster=5"
redis.clusters.read_timeout = "mycluster=10"

在redis(集群)上使用PHP模拟简单的存储会话:

one.php:

session_start ();
$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();

two.php:

session_start();
var_dump($_SESSION);

了解apache错误:

PHP Warning: session_start(): Cannot find save handler 'rediscluster' - session startup failed in /var/www/html/one.php on line 4

那里有什么想法可能是什么问题?

1 个答案:

答案 0 :(得分:0)

从save_path中删除尾部斜杠;)