php连接redis报错,PHP使用phpredis链接redis错误
如題, 項(xiàng)目中使用phpredis鏈接 redis,偶爾報(bào)如下錯(cuò)誤:
PHP Fatal error: Uncaught exception 'RedisException' with message 'Failed to AUTH connection' in [no active file]:0
Stack trace:
#0 {main}
thrown in [no active file] on line 0```
check過(guò)項(xiàng)目的配置信息正確,此錯(cuò)誤信息為偶爾出現(xiàn)
項(xiàng)目中使用redis處理session
在github的issues中發(fā)現(xiàn)有人遇到類似的問(wèn)題,但也沒(méi)有給出現(xiàn)的原因和怎么解決,傳送門github
各位在項(xiàng)目中有遇到類似的問(wèn)題的嘛, 還是直接使用 predis這個(gè)擴(kuò)展呢?
回復(fù)內(nèi)容:
如題, 項(xiàng)目中使用phpredis鏈接 redis,偶爾報(bào)如下錯(cuò)誤:
PHP Fatal error: Uncaught exception 'RedisException' with message 'Failed to AUTH connection' in [no active file]:0
Stack trace:
#0 {main}
thrown in [no active file] on line 0```
check過(guò)項(xiàng)目的配置信息正確,此錯(cuò)誤信息為偶爾出現(xiàn)
項(xiàng)目中使用redis處理session
在github的issues中發(fā)現(xiàn)有人遇到類似的問(wèn)題,但也沒(méi)有給出現(xiàn)的原因和怎么解決,傳送門github
各位在項(xiàng)目中有遇到類似的問(wèn)題的嘛, 還是直接使用 predis這個(gè)擴(kuò)展呢?
純粹吐槽,phpredis 這個(gè)擴(kuò)展是越來(lái)越蛋疼了。。。。
看錯(cuò)誤是授權(quán)相關(guān)的錯(cuò)誤,檢查一下是否是Redis有密碼,如果是集群部署的話,是否環(huán)境不一致
$client = new Predis\Client(array(
'scheme' => 'tcp',
'host' => '127.0.0.1',
'port' => 6379,
'database' => 15,
'password' => '密碼'
));
提示的鑒權(quán)失敗么
本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請(qǐng)注明出處,感謝您的尊重!
總結(jié)
以上是生活随笔為你收集整理的php连接redis报错,PHP使用phpredis链接redis错误的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: php快排,网址快排 快速排名软件 th
- 下一篇: php fckeditor,php --