Permissions to run a python script with PHP exec()
<p>I'm trying to execute the following commands in PHP:</p>

<pre><code>&lt;?php exec("xdg-open file") ?&gt;
&lt;?php exec("python file.py") ?&gt;
</code></pre>

<p>All files are in <code>/var/www/html</code>. </p>

<p>Other simpler commands seem to be working though. For example:</p>

<pre><code>&lt;?php exec("touch file.txt") ?&gt;
&lt;?php echo exec("ls") ?&gt;
&lt;?php echo exec("whoami") ?&gt;
</code></pre>

<p>I just want to be able to run any Python/shell commands using PHP (without the ones needing sudo). Is it a permission issue? If so, what can I do?</p>