Skip to content

php-fpm clear_env yes does not clear environment #4441

@kkmuffme

Description

@kkmuffme

Description

Description

The following code:

PHP-FPM
with clear_env = yes

<?php

var_dump( filter_input( INPUT_SERVER, 'REQUEST_TIME_FLOAT' ) );
var_dump( $_SERVER['REQUEST_TIME_FLOAT'] );

var_dump( filter_input( INPUT_SERVER, 'REQUEST_TIME' ) );
var_dump( $_SERVER['REQUEST_TIME'] );

Resulted in this output:

NULL
float(1737560728.0001)
NULL
int(1737560728)

But I expected this output instead:

NULL
NULL
NULL
NULL

These are the only 2 documented in https://www.php.net/manual/en/reserved.variables.server.php with that behavior

The same also happens for HOME and USER for example

It seems this is partially bc of php/php-src#17543 (comment)

Since php/php-src#17543 was marked not a bug, then this, which is the opposite case has to be a bug, otherwise it's completely arbitrary.

PHP Version

8.4

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    SAPI: FPMbugDocumentation contains incorrect information

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions