title: PHP: exec() doesn't run in the background even with ">/dev/null 2>&1 &"
body: <p>I'm calling this in my php script: </p>
  
  <pre><code>    exec("gutschein.php &gt;/dev/null 2&gt;&amp;1 &amp;");
  </code></pre>
  
  <p>Calling the script (generates a pdf and sends it away by e-mail) works, but the process is <strong>not running in the background</strong> (I checked it out with a sleep statement inside gutschein.php). The browser is hanging until execution of gutschein.php is finished.</p>
  
  <p>I also checked out the following:</p>
  
  <pre><code>    exec("/usr/bin/php gutschein.php &gt;/dev/null 2&gt;&amp;1 &amp;");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>shell_exec("/usr/bin/php gutschein.php &gt;/dev/null 2&gt;&amp;1 &amp;");
  </code></pre>
  
  <p>It doesn't change anything. The script is actually running on a linux server. Has anybody an idea what I'm doing wrong?</p>