php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81308 fpm does not starts pool when ENV is more 8000 bytes
Submitted: 2021-07-29 15:50 UTC Modified: 2021-07-30 07:44 UTC
From: igor0386 at gmail dot com Assigned:
Status: Closed Package: FPM related
PHP Version: 8.0.8 OS: debian,apline
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: igor0386 at gmail dot com
New email:
PHP Version: OS:

 

 [2021-07-29 15:50 UTC] igor0386 at gmail dot com
Description:
------------
I run the docker container with 300 env variable, but php-fpm is always down.
When I research I found that fpm return 104 code if env weight more 8000 bytes.
I try on the dockerized 8.1.0beta1, 8, 7.4, 7.2 and 7.3 from deb on the debian os.
alpine work when `env | wc -c` less 7995
debian container work when `env | wc -c` less 8119
Simple reproduce by docker-compose from `Test script:` section and check by cgi-fcgi from `Expected result:` section.



Test script:
---------------
docker-compose.yaml
version: "3"
services:
  fpm:
    image: php:8.1.0beta1-fpm-alpine3.14
#    image: php:8-fpm
#    image: php:7.4-fpm
#    image: php:7.2-fpm
    env_file: .env
    volumes:
      - ./www.conf:/usr/local/etc/php-fpm.d/www.conf

www.conf
[global]
log_level = debug
error_log = /tmp/php-fpm.log

[www]
user = www-data
group = www-data
listen = 9000
pm = dynamic
pm.max_spare_servers = 1
pm.min_spare_servers = 1
pm.start_servers = 1
pm.max_children = 1
pm.max_requests = 1
pm.status_path = /fpm-status

.env with any contents, many short ENV=value or one BIG_ENV=8000_simbols


Expected result:
----------------
root@4624397c329e:/www# env | wc -c
8118
root@4624397c329e:/www# SCRIPT_NAME=/fpm-status SCRIPT_FILENAME=/ REQUEST_METHOD=GET /usr/bin/cgi-fcgi -bind -connect localhost:9000 && echo $?
0

Actual result:
--------------
root@835b25c9bd0a:/www# env | wc -c
8119
root@835b25c9bd0a:/www# SCRIPT_NAME=/fpm-status SCRIPT_FILENAME=/ REQUEST_METHOD=GET /usr/bin/cgi-fcgi -bind -connect localhost:9000; echo $?
104


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-30 07:44 UTC] igor0386 at gmail dot com
-Status: Open +Status: Closed
 [2021-07-30 07:44 UTC] igor0386 at gmail dot com
I'm wrong. php-fpm works well, but cgi-fcgi doesn't. I used cgi-fcgi in healthcheck and the container was restarting all the time.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 10 07:01:29 2025 UTC