title: Execute python in a php script using shell_exec()
body: <p>I'm experiencing a weird problem in trying to execute python in a php server (LAMP). (safe_mode off)</p>
  
  <p>if I type:</p>
  
  <pre><code>$output = shell_exec("ls -lah");
  echo "&lt;pre&gt;$Output&lt;/pre&gt;";
  </code></pre>
  
  <p>I got the result of the <code>ls</code> command. Same for<code>$output = shell_exec("tar --version");</code> and other applications, such as gzip.</p>
  
  <p>However, if I switch for any of these lines:</p>
  
  <pre><code>$output = shell_exec("python --version");
  $output = shell_exec("python2.7 --version");
  $output = shell_exec("/usr/bin/python --version");
  $output = shell_exec("python my_script.py");
  </code></pre>
  
  <p>And other variants of this kind, I get no results. The command is not being executed, the python bitecode not made and the <code>echo</code> remains silent.</p>
  
  <p>I have also tried with the <code>exec()</code> command with no more success. </p>