title: PHP exec $PATH variable missing elements
body: <p>When I echo $PATH on my command line, it returns</p>
  
  <pre><code>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/MAMP/Library/bin:/usr/local/git/bin:/usr/X11/bin
  </code></pre>
  
  <p>When I execute this php code</p>
  
  <pre><code>exec('echo $PATH; whoami; less /etc/paths; 2&gt;&amp;1')
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>string 'echo $PATH; whoami; less /etc/paths; 2&gt;&amp;1' (length=56)
  array
    0 =&gt; string '/usr/bin:/bin:/usr/sbin:/sbin' (length=29)
    1 =&gt; string 'eric' (length=4)
    2 =&gt; string '/usr/bin' (length=8)
    3 =&gt; string '/bin' (length=4)
    4 =&gt; string '/usr/sbin' (length=9)
    5 =&gt; string '/sbin' (length=5)
    6 =&gt; string '/usr/local/bin' (length=14)
    7 =&gt; string '/Applications/MAMP/Library/bin' (length=30)
    8 =&gt; string '/usr/bin:/bin:/usr/sbin:/sbin' (length=29)
  </code></pre>
  
  <p>This is on Mac OS X. Can anyone tell me why my last two path elements are missing?</p>