title: Calling specific version of python from PHP
body: <p>I'm setting up a big system relying on python 2.7 being run through php. The call is always something like:</p>
  
  <pre><code>exec('python test.py');
  </code></pre>
  
  <p>However no matter what I do PHP keeps using python 2.4 for executing my files. Because of the size of the system I can't change in the programming, but will have to make 'python' point directly to python2.7.</p>
  
  <p>By searching around I have reached the conclusion that I should change the php env.</p>
  
  <pre><code>echo getenv("PYTHONPATH"); // NOTHING
  echo getenv("PATH"); // /bin:/usr/bin
  </code></pre>
  
  <p>I can do so through <code>putenv</code> (for example: <code>putenv("PATH=/usr/bin/python2.7:".$_ENV["PATH"]</code>), but php keeps running python 2.4 no matter what I change it to.</p>
  
  <p>Hope somebody out there got a simple solution :)</p>