title: Running exec() command with dev>null & doesn't work, but dev>null does
body: <p>I have this exec command which runs just fine, but doesn't free up the browser (ie. there is a php timeout issue, but the actual command continues to run):</p>
  
  <pre><code>exec("/usr/local/php53/bin/php csv.php $file $user &gt; /dev/null");
  </code></pre>
  
  <p>When I run <code>ps auxw</code> I see these two running processes:</p>
  
  <pre><code>sh -c /usr/local/php53/bin/php csv.php /tmp/php9Pwu9e 294  &gt;
  /usr/local/php53/bin/php csv.php /tmp/php9Pwu9e 294
  </code></pre>
  
  <p>However, when I run the code below, the browser immediately is free, but the command doesn't continue to run:</p>
  
  <pre><code>exec("/usr/local/php53/bin/php csv.php $file $user &gt; /dev/null &amp;");
  </code></pre>
  
  <p>When I run  <code>ps auxw</code> I see one running process that dies after 16 seconds (and seems to eat up memory quickly and use a lot of CPU%):</p>
  
  <pre><code>/usr/local/php53/bin/php csv.php /tmp/php9Pwu9e 294
  </code></pre>
  
  <p>Then the process dies without having actually done anything. Not sure what the ampersand is doing that would cause this. </p>
  
  <p>Also why does <code>sh -c</code> appear when no ampersand is present at the end? I feel that this may be indicative of something, but have no idea what.</p>
  
  <p><b>EDIT:</b></p>
  
  <p>Because this keeps cropping up as an answer, 
  I have also tried:</p>
  
  <pre><code>exec("/usr/local/php53/bin/php csv.php $file $user &gt; /dev/null 2&gt;&amp;1 &amp;");
  </code></pre>
  
  <p>Which demonstrates the same issue as mentioned above.
  The code below, does run, but does NOT free up the browser.</p>
  
  <pre><code>exec("usr/local/php53/bin/php csv.php $file $user &gt; /dev/null 2&gt;&amp;1");
  </code></pre>