php / php/php-src

ping stops responding when size of env chars exceeds specific amount

Open
#16,042 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug SAPI: fpm Status: Verified
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the PHP 8.3.10 and 8.4.0beta5 Docker images, using the php-fpm configuration in /usr/local/etc/php-fpm.d/www.conf and the cgi-fcgi command shown. Compare the /ping response before and after exporting 494 environment variables, then determine whether the relevant size limit is documented or configurable and what PHP-FPM behavior should be considered done.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, php, shell
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.