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? – Zoredache Aug 7 '12 at 22:06.htmlfiles than for the.phpfiles. However, theFoovariable is only available in the.phpfiles. I don't see any difference in the configuration section, though. – dotancohen Aug 8 '12 at 5:42.htmland.phpfiles will show them differently, though. – dotancohen Aug 8 '12 at 5:43