[php-src] Issue #20749: `DOCUMENT_ROOT` from environment in cli is not propagated to $_SERVER['DOCUMENT_ROOT']

From: Date: Sun, 21 Dec 2025 12:08:23 +0000
Subject: [php-src] Issue #20749: `DOCUMENT_ROOT` from environment in cli is not propagated to $_SERVER['DOCUMENT_ROOT']
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-251417@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/20749 Author: ivan-u7n ### Description The following code: ```sh DOCUMENT_ROOT=/test php -r 'var_dump($_SERVER["DOCUMENT_ROOT"]);' ``` Resulted in this output: ``` string(0) "" ``` But I expected this output instead: ``` string(5) "/test" ``` with a file the out is the same I think the culprit is https://github.com/php/php-src/blob/42f994cd05da353c93cd65775026859f664289a3/sapi/cli/php_cli.c#L344 as the only mention of DOCUMENT_ROOT for php-cli ### PHP Version ```plain PHP 8.4.15 (cli) (built: Nov 20 2025 19:00:52) (NTS) Copyright (c) The PHP Group Built by Debian Zend Engine v4.4.15, Copyright (c) Zend Technologies with Zend OPcache v8.4.15, Copyright (c), by Zend Technologies ``` ### Operating System _No response_

« previous php.bugs (#251417) next »