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 = "127.0.0.1:6379"
Warning: session_start(): Cannot find save handler 'redis' - session startup failed in /path/to/the/Untitled.php
$redis = new Predis\Client([
'scheme' => 'tcp',
'host' => '127.0.0.1',
'port' => 6379,
Connected to localhost.
Escape character is '^]'.
+1471853424.389215 [0 127.0.0.1:36912] "KEYS" "*"
$count = isset($_SESSION['cont']) ? $_SESSION['cont'] : 1;
$_SESSION['cont'] = ++$count;
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.