First a reference: Answer by George Lerner at:
To test, in [docroot]/.htaccess put a couple of lines like:
SetEnv HTTP_GRAHAMTEST httpgrahamtest
SetEnv GRAHAMTEST grahamtest
<title>Environment variables Test</title>
<?php echo '<p>Environment variables</p>'; ?>
<?php print_r($_SERVER); ?>
This program lists the server environment variables that php receives from the server in the $_SERVER variable.
Browse to yoursite.com/php_server_env.php and view results to see which of the SetEnv'ed variables can be seen from php.
Needless to say, making certain that php can see your .htaccess variables goes along way to avoiding wasting a lot of time setting up multistores with the SetEnv method, which is otherwise straightforward.
Edit: Response from hosting company
This response from the support department of a popular hosting company, provides some technical details:
The mod_env module (used for all SetEnv and SenEnvif
directives) is working properly, but suexec is cleaning all
environmental variables before passing the script for execution.
When suexec is used to launch CGI scripts, the environment will be
cleaned down to a set of safe variables before CGI scripts are
launched. The list of safe variables is defined at the time of the
Apache package compilation.
All our shared servers are using mod_hive which uses a more customized
wrapper, instead of suexec. It passes variables that begin with
"HTTP_", which then is visible in the $_SERVER array.
Unfortunately as your account is hosted on a shared hosting platform,
we are not able to revert mod_env to its default state. What we can
recommend you is to simply add HTTP_ prefix to all environment