php shell_exec won't run a working shell script? <p>I want to run a python script independent of apache. I wrote a shell script containing the following</p> <pre><code>#!/bin/bash sudo nohup python dejavu/sniffer.py $1 $2 $3 &gt; /var/log/apache2/sniffer.log 2&gt;&amp;1 &amp; echo $! </code></pre> <p>for some reason the following does nothing however, it does return a PID.</p> <pre><code>$cmd = ' ./sniffer.sh '.$audioStream." ".$content_type." ".$bit_rate; $command = escapeshellcmd($cmd); $out = shell_exec($command) </code></pre> <p>The shell script works fine on it's own. exec($cmd) does nothing as well.</p> <p>I have checked the disabled functions in the ini file, thats not the issue.</p>