title: How to add a linux environment variable for different language (PHP or RUBY)
body: <p>I would like to add a linux environment variable for my differents applications written in PHP and Ruby.</p>
  
  <p>Its goal is to differntiate between 'production' and 'development' linux environment.</p>
  
  <p><strong>How to have an linux environment variable (ex : APPLICATION_ENV='production') that can be accessed with PHP and Ruby?</strong></p>
  
  <p>thanks</p>
  
  <p><em>Edit 1 :</em></p>
  
  <p>My first solution was :</p>
  
  <p>for Apache/PHP in vhost :</p>
  
  <pre><code>SetEnv APPLICATION_ENV 'production'
  </code></pre>
  
  <p>for Ruby :</p>
  
  <pre class="lang-bsh prettyprint-override"><code>export APPLICATION_ENV='production'
  </code></pre>
  
  <pre class="lang-rb prettyprint-override"><code>puts ENV['APPLICATION_ENV']
  </code></pre>
  
  <p><strong>However, this is two places to the same value... There are no solution to merge it in one place ?</strong> <em>par exemple to use /etc/environment</em></p>
  
  <p>Edit :</p>
  
  <p>The answer of my question is detailed here : <a href="http://php.dzone.com/news/inserting-variable-headers-apa&amp;default=false&amp;zid=159&amp;browser=16&amp;mid=0&amp;refresh=0" rel="nofollow">Inserting Variable Headers in Apache</a></p>