title: Php Exec external python script - Permission Denied
body: <p>I can't run command line script from Exec</p>
  
  <pre><code>$exec = exec($command, $output, $return );
  </code></pre>
  
  <p>I have tried passthru,shell_exec,system but obviously this is not the problem.</p>
  
  <pre><code>sudo chown -R www-data:www-data /root/path/nonce.py
  sudo chmo 775 /path/nonce.py
  sudo chmo 777 /path/nonce.py
  sudo chmo 755 /path/nonce.py
  </code></pre>
  
  <p>didn't helped</p>
  
  <pre><code>exec("python -V 2&gt;&amp;1");
  </code></pre>
  
  <p>works</p>
  
  <p>But </p>
  
  <pre><code>/usr/bin/python /root/path/nonce.py 
  
   Array ( [0] =&gt; /usr/bin/python: can't open file '/root/path/nonce.py': [Errno 13] Permission denied ) 
  </code></pre>
  
  <p>dosent</p>
  
  <p>running on nginx and php5-fpm</p>