.php files see Apache environment variables, .html files don't
- by dotancohen
Consider this environment:
$ cat .htaccess
AddType application/x-httpd-php .php .html
SetEnv Foo Bar
$ cat test.php
<?php
echo "Hello: ";
echo $_SERVER['Foo'];
echo $_ENV['Foo'];
echo getenv('Foo');
?>
$ cat test.html
<?php
echo "Hello: ";
echo $_SERVER['Foo'];
echo $_ENV['Foo'];
echo getenv('Foo');
?>
This is the output of test.php:
Hello BarBarBar
This is the output of test.html:
Hello
Why might that be? How might I fix it?
Here is phpinfo.php:
http://pastebin.com/rgq7up61
Here is phpinfo.html:
http://pastebin.com/VUKFNZ36
If anyone knows where I can host a real webpage instead of just the HTML for one, please let me know and I'll move the content to there. Thanks.