title: Environment variables are not passed from .htaccess to PHP
body: <p>I am trying to pass an environment variable from .htaccess through to PHP.  This works just fine on my local WAMP server, but on the server where my website is hosted, it fails without reason.</p>
  
  <p>Here's my test configuration:</p>
  
  <p>.htaccess:</p>
  
  <pre><code>SetEnv TEST_VARIABLE test_value
  </code></pre>
  
  <p>test.php:</p>
  
  <pre><code>&lt;pre&gt;
  getenv('TEST_VARIABLE') = &lt;?php print getenv('TEST_VARIABLE'); ?&gt;
  
  getenv('REDIRECT_TEST_VARIABLE') = &lt;?php print getenv('REDIRECT_TEST_VARIABLE'); ?&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p>On my local server, getting test.php correctly returns:</p>
  
  <pre><code>getenv('TEST_VARIABLE') = test_value
  getenv('REDIRECT_TEST_VARIABLE') = 
  </code></pre>
  
  <p>But on the production server, it returns:</p>
  
  <pre><code>getenv('TEST_VARIABLE') = 
  getenv('REDIRECT_TEST_VARIABLE') = 
  </code></pre>
  
  <p>Things I've ruled out:</p>
  
  <ol>
  <li><p><code>mod_env</code> is not installed/enabled by the host.  Can't be, because then <code>SetEnv</code> would not be recognized and I'd get a 500 while processing the .htaccess.</p></li>
  <li><p><code>AllowOverrides</code> in <code>httpd.conf</code> for this directory doesn't include <code>FileInfo</code>.  Can't be, because then Apache would throw an error "SetEnv not allowed here" when encountering the <code>SetEnv</code> directive and I'd get a 500 again.</p></li>
  <li><p><code>variables_order</code> in php.ini doesn't include 'E'.  This would explain the <code>$_ENV</code> superglobal being empty (which it is), but not why <code>getenv()</code> doesn't return values for these variables.</p></li>
  <li><p>Entire environment is screwed up.  Can't be, because <code>getenv('PATH')</code> and <code>getenv('SERVER_NAME')</code> still return valid values.</p></li>
  </ol>
  
  <p>At this point I'm at a loss as to what configuration could be causing this.</p>