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.
phpinfo();
in the .html file? Do you see any differences from what you see in a .php file? Are you sure your Apache configuration isn't adjusting the configuration with a<files>
directive or anything?.html
files than for the.php
files. However, theFoo
variable is only available in the.php
files. I don't see any difference in the configuration section, though..html
and.php
files will show them differently, though.