title: PHP exec() as Background Process (Windows Wampserver Environment)
body: <p>I'm trying to setup a php trigger file that will set off a background process. (see <a href="https://stackoverflow.com/questions/5361644/use-php-to-trigger-another-php-script-then-ignore">this question</a>)</p>
  <p>I'm doing this on a Windows Wampserver environment.</p>
  <p>So for example I have <code>trigger.php</code> that runs the exec function that calls for my <code>backgroundProcess.php</code> to be parsed and executed.</p>
  <p>However the problem is that my <code>trigger.php</code> file is waiting for the <code>exec()</code> command to finish running <code>backgroundProcess.php</code> before it stops. The background process runs for about 20-30 seconds, and <code>trigger.php</code> is waiting all that time until <code>backgroundProcess.php</code> has fully finished.</p>
  <p>Is that making sense? Here is the <code>trigger.php</code> file that runs the <code>exec()</code> command</p>
  <pre><code>exec('C:\wamp\bin\php\php'.phpversion().'\php.exe -f C:\path\to\backgroundProcess.php &gt; C:\wamp\bin\php\php'.phpversion().'\dev\null &amp;');
  </code></pre>
  <p>Basically, I'm wanting <code>trigger.php</code> to just trigger off the backgroundProcess and not wait around for it to finish.</p>