-
Couldn't load subscription status.
- Fork 8k
Closed as not planned
Labels
Description
Description
In Apache and nginx environments, we can modify $_SERVER through configuration files
In CLI environments, we can modify $_SERVER through environment variables
but in builtin server ,
I canont modify $_SERVER through environment variables,
I canont find a way to modify $_SERVER,
I hope to find a way to modify $_SERVER in the builtin server
The following code:
test.php
<?php
echo isset($_SERVER['HTTPS']) ? '$_SERVER HTTPS exists' : '$_SERVER HTTPS not exists';
echo PHP_EOL;
echo !empty(getenv('HTTPS')) ? 'getenv HTTPS exists' : 'getenv HTTPS not exists';
echo PHP_EOL;start builtin server
export HTTPS="on" php -S 127.0.0.1:8080curl 127.0.0.1:8080/test.php
Resulted in this output:
$_SERVER HTTPS not exists
getenv HTTPS exists
But I expected this output instead:
$_SERVER HTTPS exists
getenv HTTPS exists
PHP Version
PHP 8.3
Operating System
Debian GNU/Linux 12 (bookworm)