Xaretre Xaretre - 1 month ago 8x
PHP Question

Cannot find save handler 'redis' - Ubuntu

I am running LAMPP on ubuntu with PHP 5.6.23.

I decided to store my sessions in the Redis and I installed it. I also installed Predis too.

As a searched in the web I changed my php.ini to :

session.save_handler = redis
session.save_path = ""

But when tried create a session I am taking this error:

Warning: session_start(): Cannot find save handler 'redis' - session startup failed in /path/to/the/Untitled.php

You can think that there is a problem in Redis but it's not. It's working properly I can set something and I can check it with Redis-CLI :

My redis 'set' PHP code is :


require "predis/autoload.php";
$redis = new Predis\Client([
'scheme' => 'tcp',
'host' => '',
'port' => 6379,
$redis->set('x', '42');


Results in telnet:

Connected to localhost.
Escape character is '^]'.
+1471853424.389215 [0] "KEYS" "*"

Session php code:


$count = isset($_SESSION['cont']) ? $_SESSION['cont'] : 1;

echo $count;

$_SESSION['cont'] = ++$count;

It must increase the number every refresh but It just displays an error.

I re-Installed Redis again (v 3.2.3) but still no difference.

Is there any way to solve it?

Could LAMPP be the reason of problem?


I started to use phpredis instead of predis.


You try different things. Predis is a direct client to your Redis Server. If you want to use them as your session handler you have to install the php module.

sudo apt-get install php5-redis

or for PHP7

sudo apt-get install php7.0-redis

Then "redis" should be available as session handler.