php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75994 Environment permanently breaks for worker process.
Submitted: 2018-02-22 13:49 UTC Modified: 2018-02-23 03:50 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sam at mousa dot nl Assigned:
Status: Open Package: FPM related
PHP Version: 7.1.14 OS: Alpine
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sam at mousa dot nl
New email:
PHP Version: OS:

 

 [2018-02-22 13:49 UTC] sam at mousa dot nl
Description:
------------
# Test setup
pm = static
pm.max_children = 1
env[testcase] = test

Refresh the page below several times...

Based on the assumption that the environment is never changed 

Test script:
---------------
<?php

if ($_SERVER['testcase'] === 'test') {
    echo 'Everything is fine; trying to break your env...';
    foreach($_SERVER as $key => &$value) {
        putenv("$key=$value");
    }
} else {
    phpinfo(INFO_ENVIRONMENT);
}
die();

Expected result:
----------------
The test script above should consistently output:

Everything is fine; trying to break your env...



Actual result:
--------------
After a few refreshes it shows the environment part of phpinfo().

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-22 14:11 UTC] sam at mousa dot nl
After some more research this does not seem related to the usage of a reference.
Instead the following code will also break the environment:
putenv('testcase=12345');

It won't break if the env[testcase] entry is removed from the fpm config.
 [2018-02-23 03:50 UTC] laruence@php.net
I can not reproduce this... :<
 [2018-03-12 15:26 UTC] d dot schniepp at semlabs dot de
We can confirm this issue. It appeared on our docker based env since 7.1.15 and 7.2.1. We are using the php:7.2-fpm-alpine docker image on multi-docker aws elastic beanstalk infant of an nginx. For now we pinned our image to 7.1.13.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 03:01:26 2018 UTC