php / php/php-src

ping stops responding when size of env chars exceeds specific amount

未关闭
#16,042 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug SAPI: fpm Status: Verified
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

i can reproduce this with the official docker images (tried php:8.3.10-fpm-alpine3.19 and php:8.4.0beta5-fpm-alpine3.20) doing this:

docker run --rm --name phptest php:8.3.10-fpm-alpine3.19 sh -c "apk add --no-cache fcgi && \
  sed -i '/ping\.path/d' /usr/local/etc/php-fpm.d/www.conf && \
  sed -i '/ping\.response/d' /usr/local/etc/php-fpm.d/www.conf && \
  echo 'ping.path = /ping' >> /usr/local/etc/php-fpm.d/www.conf && \
  echo 'ping.response = pong' >> /usr/local/etc/php-fpm.d/www.conf && \
  php-fpm"

when i enter the container and trigger the ping it looks like this:

# SCRIPT_NAME=/ping SCRIPT_FILENAME=/ping REQUEST_METHOD=GET cgi-fcgi -bind -connect 127.0.0.1:9000
X-Powered-By: PHP/8.3.10
Content-type: text/plain;charset=UTF-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0

pong

when i now create a bunch of envs, ping stops working:

i=1; while [ $i -le 494 ]; do export TEST_ENV_$i=f; i=$((i + 1)); done && SCRIPT_NAME=/ping SCRIPT_FILENAME=/ping REQUEST_METHOD=GET cgi-fcgi -bind -connect 127.0.0.1:9000

maybe this is not a bug, but i could not find any information regarding a size/limit that can be configured. it looks that my php application still works, even if ping does not respond anymore.

thx for any information or hints 🙏

PHP Version

tested with php:8.3.10-fpm-alpine3.19 and php:8.4.0beta5-fpm-alpine3.20

Operating System

docker alpine 3.19 and 3.20

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 PHP 8.3.10 和 8.4.0beta5 的 Docker 镜像,采用 /usr/local/etc/php-fpm.d/www.conf 中的 php-fpm 配置以及所示的 cgi-fcgi 命令,复现该行为。比较导出 494 个环境变量前后的 /ping 响应,然后确定相关的大小限制是否有文档说明或可配置,以及哪种 PHP-FPM 行为应被视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
docker, php, shell
领域
backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。