如题, 项目中使用phpredis
链接 redis
,偶尔报如下错误:
<code>PHP Fatal error: Uncaught exception 'RedisException' with message 'Failed to AUTH connection' in [no active file]:0Stack trace:#0 {main} thrown in [no active file] on line 0```</code>
-
check
过项目的配置信息正确,此错误信息为偶尔出现 -
项目中使用
redis
处理session
-
在
github
的issues
中发现有人遇到类似的问题,但也没有给出现的原因和怎么解决,传送门github
各位在项目中有遇到类似的问题的嘛, 还是直接使用 predis
这个扩展呢?
回复内容:
如题, 项目中使用phpredis
链接 redis
,偶尔报如下错误:
<code>PHP Fatal error: Uncaught exception <strong style="color:transparent">来2源gaodaima#com搞(代@码&网</strong><label>搞gaodaima代码</label>'RedisException' with message 'Failed to AUTH connection' in [no active file]:0Stack trace:#0 {main} thrown in [no active file] on line 0```</code>
-
check
过项目的配置信息正确,此错误信息为偶尔出现 -
项目中使用
redis
处理session
-
在
github
的issues
中发现有人遇到类似的问题,但也没有给出现的原因和怎么解决,传送门github
各位在项目中有遇到类似的问题的嘛, 还是直接使用 predis
这个扩展呢?
纯粹吐槽,phpredis 这个扩展是越来越蛋疼了。。。。
看错误是授权相关的错误,检查一下是否是Redis有密码,如果是集群部署的话,是否环境不一致
<code>$client = new Predis\Client(array( 'scheme' => 'tcp', 'host' => '127.0.0.1', 'port' => 6379, 'database' => 15, 'password' => '密码'));</code>
提示的鉴权失败么