Home  >  Article  >  Backend Development  >  redis添加密码后,存储不了session

redis添加密码后,存储不了session

WBOY
WBOYOriginal
2016-06-23 13:29:361250browse


ini_set('session.save_handler', 'redis');ini_set('session.save_path', 'tcp://127.0.0.1:6379?auth=test');session_start();$_SESSION['sessionid'] = 'Hello world!';


        以上代码,在redis设置密码后,执行完在redis里没发现生成的session数据;如果把redis不设置密码却又可以成功。哪位大侠帮忙看看,是什么问题


回复讨论(解决方案)

打开调试后报

Warning: Unknown: Failed to write session data (redis). Please verify that the current setting of session.save_path is correct (tcp://127.0.0.1:6379?auth=test) in Unknown on line 0

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Laravel中URL,ACTION,ROUTE区别Next article:PHP图片水印