doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

php-fpm clear_env yes does not clear environment

Open kkmuffme opened this issue 1 year ago • 1 comments

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 https://github.com/php/php-src/issues/17543#issuecomment-2614521724

Since https://github.com/php/php-src/issues/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

kkmuffme avatar Feb 03 '25 15:02 kkmuffme

This is a doc issue because clear_env is just for clearing external environment variables.

bukka avatar Feb 05 '25 16:02 bukka