【发布时间】:2018-09-12 00:44:31
【问题描述】:
我创建了 docker 镜像,其中包括 Debian 软件包 nginx-full, php7.0, php7.0-fpm, php-zmq 和用 PHP 编写的应用程序代码。
当我尝试从浏览器调用应用程序(基本上是调用 zeroMQ)时,我收到 502 bad gateway 错误。如何判断是服务器问题还是代码问题?
尝试更改套接字文件的权限并 无法打印 PATH_INFO 变量。
Nginx 日志:
157#157: *622 recv() failed (104: Connection reset by peer) while reading response header from upstream,
PHP-FPM 日志:
[02-Apr-2018 16:05:26] WARNING: [pool www] child 197 exited on signal 11 (SIGSEGV) after 79.435089 seconds from start
[02-Apr-2018 16:05:26] NOTICE: [pool www] child 203 started
nginx 配置:
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include /etc/nginx/fastcgi_params;
}
PHP-FPM 配置:
user = www-data
group = www-data
//tried 127.0.0.1:900 but did not work
listen = /run/php/php7.0-fpm.sock
收到错误后,当我重新加载php-fpm 时,错误消失了。但之后会再次发生。
【问题讨论】:
-
欢迎来到 Stack Overflow!我更新了您问题的格式以提高可读性并包含标签 php-7。这有助于了解该主题的用户更轻松地发现问题。您已经将标题格式化为粗体。为了正确渲染标记,意图和额外行的间距很重要。有关格式化的更多信息,请参阅*.com/editing-help。请验证您的问题内容现在看起来是否正确。祝你好运!