; Enable redis extension module ; extension=redis.so ; Should the locking be enabled? Defaults to: 0. ; redis.session.locking_enabled = 1 ; How long should the lock live (in seconds)? Defaults to: value of max_execution_time. ; redis.session.lock_expire = 60 ; How long to wait between attempts to acquire lock, in microseconds (µs)?. Defaults to: 2000 ; redis.session.lock_wait_time = 50000 ; Maximum number of times to retry (-1 means infinite). Defaults to: 10 ; redis.session.lock_retries = 10 ; CLUSTER ; Define cluster seed nodes, with cluster name "mycluster" ; redis.clusters.seeds = "mycluster[]=localhost:7000&test[]=localhost:7001" ; The amount of time phpredis will wait when connecting or writing to the cluster. ; redis.clusters.timeout = "mycluster=5" ; The amount of time phpredis will wait for a result from the cluster. ; redis.clusters.read_timeout = "mycluster=10" ; The password used to authenticate with the cluster prior to sending commands. ; redis.clusters.auth = "mycluster=password" ; SESSION HANDLER ; Set redis as PHP session save-handler ; session.save_handler = redis ; ; Set redis connection string for single host, via tcp ; session.save_path = "host1:6379" ; ; You can specify parameters, but then the tcp:// scheme needs to be used. ; The following parameters are supported: ; - weight (integer): the weight of a host is used in comparison with the ; others in order to customize the session distribution on several hosts. ; If host A has twice the weight of host B, it will get twice the amount ; of sessions. In the example, host1 stores 20% of all the sessions ; (1/(1+2+2)) while host2 and host3 each store 40% (2/(1+2+2)). The target ; host is determined once and for all at the start of the session, and ; doesn't change. The default weight is 1. ; - timeout (float): the connection timeout to a redis host, expressed in ; seconds. If the host is unreachable in that amount of time, the session ; storage will be unavailable for the client. The default timeout is very ; high (86400 seconds). ; - persistent (integer, should be 1 or 0): defines if a persistent connection ; should be used. (experimental setting) ; - prefix (string, defaults to "PHPREDIS_SESSION:"): used as a prefix to the ; Redis key in which the session is stored. The key is composed of the ; prefix followed by the session ID. ; - auth (string, or an array with one or two elements): used to authenticate ; with the server prior to sending commands. ; - database (integer): selects a different database. ; ; session.save_path = "tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2&read_timeout=2.5" ; ; Set redis connection string for unix socket ; session.save_path = "unix:///var/run/redis/redis.sock?persistent=1&weight=1&database=0" ; Set a redis cluster as PHP session save-handler ; session.save_handler = rediscluster ; ; The save path for cluster based session storage takes the form of a PHP GET ; request, and requires that you specify at least one seed node. Other options ; you can specify are as follows: ; - timeout (double): The amount of time phpredis will wait when connecting or ; writing to the cluster. ; - read_timeout (double): The amount of time phpredis will wait for a result ; from the cluster. ; - persistent: Tells phpredis whether persistent connections should be used. ; - distribute: phpredis will randomly distribute session reads between ; masters and any attached slaves (load balancing). ; - failover (string): How phpredis should distribute session reads between ; master and slave nodes. ; none : phpredis will only communicate with master nodes ; error: phpredis will communicate with master nodes unless one fails, ; in which case an attempt will be made to read session information ; from a slave. ; - auth (string, empty by default): The password used to authenticate with ; the server prior to sending commands. ; - stream (array): ssl/tls stream context options. ; ; session.save_path = "seed[]=host1:port1&seed[]=host2:port2&seed[]=hostN:portN&timeout=2&read_timeout=2&failover=error&persistent=1&auth=password&stream[verify_peer]=0"