【问题标题】:"Connection reset by peer while reading response header from upstream" error while using PHP(7.4) Exception使用 PHP(7.4) 异常时出现“从上游读取响应标头时由对等方重置连接”错误
【发布时间】:2022-11-04 18:13:45
【问题描述】:

每当我在Phalcon 4 应用程序中抛出异常时,我都会收到 502 bad gateway。我正在使用实现Throwable 接口的默认PHP Exception 类。

throw new Exception ("Some error message here", 500);

我浪费了很多时间,看了所有关于这个问题的帖子,但找不到解决方案。

当我检查我的 nginx 日志时,它总是说

Connection reset by peer while reading response header from upstream

有时(15%)它会抛出异常并给我消息,但大多数情况下它只显示 502。

我很确定它与我的代码无关,因为如果是这种情况,那么它有时甚至不应该工作。

【问题讨论】:

    标签: php nginx phalcon fastcgi fpm


    【解决方案1】:

    通过在php-fpm.conf (etcphp.4pm) 文件中将log_level 更改为notice 解决了我的问题:

    【讨论】:

      猜你喜欢
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 2018-02-21
      • 2016-01-04
      • 2020-06-27
      • 2019-05-04
      • 2017-04-01
      • 1970-01-01
      相关资源
      最近更新 更多