PHP Redis错误:未捕获异常‘;再贴现例外情况&x2019;

PHP Redis错误:未捕获异常‘;再贴现例外情况&x2019;,php,redis,Php,Redis,我使用Redis构建IOS SNS应用程序(用于restful api)。随着越来越多的用户使用它,错误就发生了 它抛出: Uncaught exception 'RedisException' with message 'read error on connection' in /data1/www/htdocs/11/iossns/Model/Core/Redis.php 我不知道如何解决这个问题 你能帮忙吗 谢谢大家! 您使用的是什么PHP到Redis库。你的网络服务器是什么?(Apa

我使用Redis构建IOS SNS应用程序(用于restful api)。随着越来越多的用户使用它,错误就发生了

它抛出:

Uncaught exception 'RedisException' with message 'read error on connection' 
in /data1/www/htdocs/11/iossns/Model/Core/Redis.php
我不知道如何解决这个问题

你能帮忙吗


谢谢大家!

您使用的是什么PHP到Redis库。你的网络服务器是什么?(Apache、nginx等)PHP是如何运行的?(CGI、FPM、mod_php等)

。事实证明,phpredis目前不支持与phpfpm的持久连接。phpredis的2.2.3版有一些连接处理更改,可能会降低问题的发生频率

我建议检查您的Redis连接器配置以

  • 禁用持久连接
  • 启用连接重试
  • 增加日志冗余度

  • 您还可以考虑对PHP .IN../P> < P> >(一般增加)<代码> Debug ToCKTyTimeOuto> <代码> >我在Ubuntu 20.04中发现系统CTL试图重新启动服务,因为它找不到/Run/ReiS/ReSIS-Serv.PID。 redis-server.service:失败,结果为“超时”

    Feb 25 17:51:09 artamredis systemd[1]: Failed to start Advanced key-value store.
    Feb 25 17:51:09 artamredis systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 18.
    Feb 25 17:51:09 artamredis systemd[1]: Stopped Advanced key-value store.
    Feb 25 17:51:09 artamredis systemd[1]: Starting Advanced key-value store...
    Feb 25 17:51:09 artamredis systemd[1]: redis-server.service: Can't open PID file /run/redis/redis-server.pid (yet?) after start: Operation not permitted
    
    为了在/etc/redis/redis.conf文件中解决此问题,请查找

    pidfile /var/run/redis_6379.pid
    
    换成

    pidfile /run/redis/redis-server.pid
    

    检查Redis实例是否正在运行,您可以连接Redis cli(即不是从php)。您的代码在哪里??它们是你用来连接Redis的吗???