Description
The following code:
DOCUMENT_ROOT=/test php -r 'var_dump($_SERVER["DOCUMENT_ROOT"]);'
Resulted in this output:
But I expected this output instead:
with a file the out is the same
I think the culprit is
|
if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len)) { |
as the only mention of
DOCUMENT_ROOT for php-cli
PHP Version
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