My .htaccess:
SetEnv tvar "my value"
RewriteEngine on
RewriteRule .* - [E=boostpath:normal]
My virtual host settings:
AllowOverride All
Options FollowSymLinks
Require all granted
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9001/home/dir/public_html/www.site.com/$1
My php file:
<?php
putenv("foo=bar");
echo "<br><br>env";
echo getenv("foo"); #works, outputs bar
echo "<br><br>env2";
echo getenv("tvar"); #doesn't work, empty
echo getenv("REDIRECT_tvar"); #doesn't work, empty
echo "<br><br>";
echo "<br><br>env3";
echo getenv("boostpath"); #doesn't work, empty
echo getenv("REDIRECT_boostpath"); #doesn't work, empty
echo "<br><br>";
print_r($_ENV) is also empty. But I tried turning variables_order = 'EGPCS' in php.ini and $_ENV shows up right but without any of the .htaccess set variables, and the result of the script is the exact same. Need this to work for a site to be able to cache both mobile and not mobile viewers in different directories.