codelgniter Failed to write session data (user). Please verify that the ...
2018-03-20 16:00
656 查看
在使用codelgniter 中config/config.php 中 要把session 存储方式改为 redis 结果报错了!如下:
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (.....) in Unknown on line 0$config['sess_save_path'] = 'tcp://127.0.0.1:6379';地址肯定是对的,也不需要auth , 使用redis-cli 也能连接到redis服务。
网上查了会,有说 是phpredis版本太低, 我的phpredis 扩展 版本 3.1.9 ;redis版本3.2.9; 虽然不一致,但也不低呀。
会不会是框架问题,我把 system 目录 替换为 3.1.7(最新最稳定的codelgniter)的system 目录,果然不报错了!
总结下:出现类似问题,可能原因 是 phpredis扩展 和 redis版本不匹配;框架使用 phpredis 有问题(框架比 phpredis扩展老);如果是使用predis 还可能它的版本问题。
解决了顺序,先最容易改的,如框架, 再考虑phpredis版本 或predis问题。 最后再考虑redis服务版本。
还要注意 是否有auth !
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (.....) in Unknown on line 0$config['sess_save_path'] = 'tcp://127.0.0.1:6379';地址肯定是对的,也不需要auth , 使用redis-cli 也能连接到redis服务。
网上查了会,有说 是phpredis版本太低, 我的phpredis 扩展 版本 3.1.9 ;redis版本3.2.9; 虽然不一致,但也不低呀。
会不会是框架问题,我把 system 目录 替换为 3.1.7(最新最稳定的codelgniter)的system 目录,果然不报错了!
总结下:出现类似问题,可能原因 是 phpredis扩展 和 redis版本不匹配;框架使用 phpredis 有问题(框架比 phpredis扩展老);如果是使用predis 还可能它的版本问题。
解决了顺序,先最容易改的,如框架, 再考虑phpredis版本 或predis问题。 最后再考虑redis服务版本。
还要注意 是否有auth !
相关文章推荐
- SecureCRT通过SSH服务登录ubuntu出错:Password authentication failed, Please verify that the username and passw
- Password authentication failed, Please verify that the username and password are correct
- MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error
- PHP+mysql系统报错:PHP message: PHP Warning: Unknown: Failed to write session data (files)
- 运行某应用系统一模快时提示:Error creating object Please verify that the Microsoft Data Access Components 2.1 (or later) have been pro
- PHP+mysql系统报错:PHP message: PHP Warning: Unknown: Failed to write session data (files)
- Failed to write image data for the launch image set from "LaunchImage.launchimage/1242_2208.png" to
- #Redis Error #MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details a
- git error:gpg failed to sign the data fatal: failed to write commit object
- Custom tool error: Failed to generate code for the service reference ××××××. Please check other error and warning messages for details.
- Error creating object Please verify that the Microsoft Data Access Components 2.1 (or later) have been properly installe
- Write a Servlet Application that uses a cookie to track the number of times a user visits a web site
- Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path 解决(VS2010+IIS7.5)
- ATL项目编译注册dll的时候报权限错误:error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
- Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- Error creating object Please verify that the Microsoft Data Access Components 2.1 (or later) have been properly installe
- 运行某应用系统一模快时提示:Error creating object Please verify that the Microsoft Data Access Components 2.1 (or later) have been pro
- MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error
- [Yii Framework] how to add additional data to the user session