title: Python script does not execute from PHP invocation
body: <p>I am trying to execute a Python Script as a response to my PHP code. This is what my Python Script looks like (for testing purposes ofcourse):</p>
  
  <pre class="lang-python prettyprint-override"><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  print 'test'
  
  import sys
  sessionDir = sys.argv[1][:-14]
  sys.stdout = open(sessionDir + 'output.txt','w')
  
  print sessionDir
  
  sys.stdout.close()
  </code></pre>
  
  <p>My PHPCode looks like the following:
  </p>
  
  <pre><code>global $calculationDir, $calculation, $userFilesDir;
  //$pythonExe = '"D:\\WinPython-64bit-2.7.10.3\\WinPython Command Prompt.exe" python ';
  //$pythonExe = 'abaqus python ';
  $pythonExe = 'python ';
  $scriptFile = '"'.$_SERVER['APPL_PHYSICAL_PATH'].substr($calculationDir,2).$calculation.'\\python\\test.py" ';
  $dataFile = '"'.$userFilesDir.$_SESSION['user'].'\\'.$calculation.'\\'.$this-&gt;sessionID.'\\Parameters.dat"';
  $command = escapeshellcmd($pythonExe.$scriptFile.$dataFile);
  
  echo passthru('ipconfig').'&lt;br&gt;';
  
  $output = passthru($command);
  echo $output.'&lt;br&gt;';
  </code></pre>
  
  <p>The <code>passthru($command)</code> does not execute the python script. The command line works just fine if I type it in the command console by hand. For testing purposes I also print my <code>ipconfig</code>just to test if the function works - which it does.</p>
  
  <p>As you can see in my code I have three approaches to call the python intepreter. First is a portable python version, second is abaqus python and third is the systempath to python. And here is the tricky part. The script does work with abaqus python but neither of the other two pythons.</p>
  
  <p>I also tried <code>exec(), shell_exec(), system()</code> instead of <code>passthru()</code>, which did not change anything. The users are also granted full access on the python script. What am I missing? Do you have any Ideas what else I should try to see if the python script is executed? (Is there a lack of information you need me to provide?)</p>
  
  <p><hr>
  Edit:</p>
  
  <p>It runs on an IIS 7 Web-Server. - I changed the permission for the python Script via the Windows File-Explorer and also via the IIS-Programm (for the whole folder).</p>