php - Cannot find save handler 'redis'


I am running a PHP 5.4 hosted Web App on Azure. To manage session handling I have configured a Redis cache instance on Azure.

I have set the session save path & handler:

session.save_handler = redis
session.save_path = "tcp://***"

I have also configured the Redis extensions:

PHP_EXTENSIONS  bin\php_igbinary.dll
APPSETTING_PHP_EXTENSIONS   bin\php_igbinary.dll
PHP_EXTENSIONS02    bin\php_redis.dll

However when I browse to my website I receive the message:

Warning: session_start(): Cannot find save handler 'redis' - session startup failed in D:\home\site\wwwroot\index.php(22) : eval()'d code on line 2

What am I missing?




[Update Pre post]

When deployed PHP project, we need enable extensions on Azure. Please see my website folder structure:

enter image description here

I copied the DLL files into folder namedext. And those dlls' version should be VC9 and non-thread-safe (nts) compatible.

enter image description here

And I created aextension.ini into folder nameini. The content as following :

session.save_handler = redis
session.save_path = "tcp://****

At last, I add the "PHP_INI_SCAN_DIR" Configurtation Panel on Azure portal:

enter image description here

It works for me.




Actually, I tried PHPRedis extension on my environment, it works fine.

Form your description, I think you made configuration of Redis extensions complicated.

I followed those steps:

1.Switch toPHP version 5.4

2.Download PHPRedis extension form this page. Since I used PHP which version isversion 5.4 TS, I downloadedphpredis_5.4_vc9_ts

3.After unzipped the download file, Please copy those DLL file into your PHPext folder. It seems that you need pay attention to this point.

Add this code into yourPHP.ini file


session.save_handler = redis
session.save_path = "tcp://****

4.Create a Page and test Redis Code:

$redis=new Redis();
$redis->pconnect('tcp://**', 6379);
$redis->set('key', 'hello '); 
$redis->append('key', 'world '); 
echo $redis->get('key');



had similar issues. make sure redis dll file is there and enabled in php.ini also make sure that redis folder has full write permissions.

People are also looking for solutions to the problem: mysql - Issue uploading WebM files using PHP


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.