title: $PATH environment variable for apache2 on mac
body: <p>I am trying to get apache/php to recognize the path to my git. I have been researching and looking in all corners of the web and cannot find how to do this. Basically, no matter what I try, when I run <code>echo phpinfo();</code> the <code>Apache Environment</code> path does not change from <code>/usr/bin:/bin:/usr/sbin:/sbin</code>. And when I run <code>system('echo $PATH');</code> in PHP, it reads the same.</p>
  
  <p><strong>System Information:</strong></p>
  
  <ul>
  <li>Mac OSX (Lion)</li>
  <li>Apache 2 (running as _www)</li>
  <li>PHP 5.3.6</li>
  </ul>
  
  <p>Here is what I have tried editing so far:</p>
  
  <ul>
  <li>/etc/profile</li>
  <li>~/.bash_profile</li>
  <li>~/.profile</li>
  <li>/etc/path</li>
  <li>/etc/path.d/{NEW_FILE}</li>
  </ul>
  
  <p>Nothing I have tried so far has changed the <code>$PATH</code> variable. Any ideas?</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>So here is the final solution. I edited the </p>
  
  <pre><code>/System/Library/LaunchDaemons/org.apache.httpd.plist
  </code></pre>
  
  <p>and added</p>
  
  <pre><code>&lt;key&gt;EnvironmentVariables&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;PATH&lt;/key&gt;
      &lt;string&gt;/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin&lt;/string&gt;
  &lt;/dict&gt;
  </code></pre>