【问题标题】:phpredis can not connect to 127.0.0.1:6379phpredis 无法连接到 127.0.0.1:6379
【发布时间】:2016-11-20 05:09:21
【问题描述】:

以下是错误信息:

Fatal error: Uncaught exception 'RedisException' with message 'Can't connect to 127.0.0.1:6379' in /var/www/html/index.php:3 Stack trace:
#0 /var/www/html/index.php(3): Redis->connect('127.0.0.1', 6379) #1 {main} thrown in /var/www/html/index.php on line 3

但实际上当使用redis-cli连接127.0.0.1:6379时,它仍然有效。 phpredis 是从 GitHub 克隆出来的,带有 master 分支,本地 phpversion 是 5.4。

谢谢!

【问题讨论】:

    标签: php redis


    【解决方案1】:

    终于找到问题了:

    setenforce 0

    我不知道为什么,但它有效!

    可能对你们有帮助...

    【讨论】:

      猜你喜欢
      • 2023-03-18
      • 2017-05-16
      • 2020-08-27
      • 2019-02-04
      • 2016-11-30
      • 2017-07-06
      • 2020-12-04
      • 2022-01-16
      • 2017-07-20
      相关资源
      最近更新 更多