Phpredis: Difference between redis and rediscluster PHP Session handler setup

Created on 27 May 2017  路  1Comment  路  Source: phpredis/phpredis

Hi there,

I want to know the correct way to setup rediscluster as PHP Session handler.

Before trying to use Redis Cluster as PHP Session handler i have tried to use single Redis server as PHP Session handler and what did was this:

edit php.ini:

session.save_handler = redis

session.save_path = "tcp://10.133.14.9:6379?auth=PASSWORD"

and that worked.

Now i want to use Redis Cluster as PHP Session instead.
So i read on internet that " session.save_handler " must contain " rediscluster " instead of " redis ", so it must be like this:

session.save_handler = rediscluster

is that correct ?

Beside being correct is session.save_path still the same format ? like:

session.save_path = "tcp://10.133.14.9:6379?auth=PASSWORD"

becouse i have seen people writing it like this:

session.save_path = "seed[]=127.0.0.1:7000&seed[]=127.0.0.1:7001&seed[]=127.0.0.1:7002&timeout=3&read_timeout=3&failover=error"

and that got me confused...can someone please explain to me so we can understand the changes if there is any???

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RobChen picture RobChen  路  4Comments

thilinadinith picture thilinadinith  路  5Comments

galves picture galves  路  6Comments

fidelhuang picture fidelhuang  路  5Comments

koleo picture koleo  路  4Comments