【问题标题】:How to get rest of this NGINX 203 error from PHP-FPM如何从 PHP-FPM 获取此 NGINX 203 错误的其余部分
【发布时间】:2020-02-22 02:15:43
【问题描述】:

我不断收到来自 NGINX 的 203 错误,并且可以使用一些帮助来解决它。 当我转到http://localhosthttp://localhost/index 等时出现此错误。 该网站运行良好。

[error] 60#60: *203 FastCGI sent in stderr: "PHP message:" while reading response header from upstream, client: ::1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "localhost"
2019/10/25 13:34:35 [error] 60#60: *203 FastCGI sent in stderr: "PHP message:" while reading response header from upstream, client: ::1, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "localhost", referrer: "http://localhost/"

会议:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /mnt/c/Users/me/src/site;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;


        server_name _;


location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;

                # Make sure unix socket path matches PHP-FPM configured path above
                fastcgi_pass unix:/run/php/php7.2-fpm.sock;

                # Prevent ERR_INCOMPLETE_CHUNKED_ENCODING when browser hangs on response
                fastcgi_buffering off;
        }

}

我假设它可能与此有关: Strange Nginx behavior with trailing slashes。但我不完全明白。

【问题讨论】:

  • 尝试在 server_name 下添加这个:error_log /var/log/nginx/error.log error;,重启 nginx,看看那个错误日志是否能提供更多信息。
  • 添加并重启 NGINX,没有变化。但是,我注意到我的路线不起作用。配置中一定有什么问题...
  • 该行不会使它开始工作,但它应该希望能将更好的错误消息写入该错误日志。检查日志以查看是否提供更多信息。
  • 错误实际上来自 PHP,通过 stderr 发出并通过 php-fpm 中继到 Nginx。您可以尝试将 PHP 配置为将错误写入其自己的错误日志文件,而不是将它们写入 stderr。检查php.ini 文件和指令,例如log_errorserror_log
  • 我有一些小问题。但接受的答案回答了我实际提出的问题。谢谢!

标签: php nginx fpm


【解决方案1】:

HTTP 代理位于客户端和服务器(源)之间。在某些情况下,HTTP 代理可能会在响应到达客户端之前对其进行更改。

那么,你真的确定你得到的 203 错误来自你的 nginx 服务器吗?

【讨论】:

    猜你喜欢
    • 2016-08-25
    • 2013-09-28
    • 1970-01-01
    • 2016-05-25
    • 1970-01-01
    • 1970-01-01
    • 2019-02-01
    • 2011-04-06
    • 1970-01-01
    相关资源
    最近更新 更多