title: php start php script and continue
body: <p>At the moment I have a line of code like this:</p>
  
  <pre><code>system("/usr/bin/php myphpscript.php --param=".val);
  </code></pre>
  
  <p>Is there a way to make php <em>not</em> wait for the script to finish - and just move on instead?</p>
  
  <p>It's a loop moving email, and the myphpscript.php is parsing the mails. And I <strong>don't</strong> wan't to wait for myphpscript.php to finish each time - just start it and move on!</p>
  
  <p><strong>UPDATE SOLUTION</strong></p>
  
  <p>Found the answer here:</p>
  
  <p><a href="http://www.php.net/manual/en/function.exec.php#101506" rel="nofollow">http://www.php.net/manual/en/function.exec.php#101506</a></p>
  
  <pre><code>passthru("/usr/bin/php myphpscript.php --param=".val." &gt;&gt; /dev/null 2&gt;&amp;1 &amp;");
  </code></pre>
  
  <p>Exp:</p>
  
  <blockquote>
    <blockquote>
      <p>/dev/null</p>
    </blockquote>
  </blockquote>
  
  <p>I needed to write to something else that STDOUT, else PHP will hang untill script finish. So I write to /dev/null instead.</p>
  
  <pre><code>2&gt;&amp;1
  </code></pre>
  
  <p>Redirecting errors to STDOUT</p>
  
  <pre><code>&amp;
  </code></pre>
  
  <p>"Run in background" as mentioned in this thread.</p>
  
  <p>Have a good day!</p>
  
  <ul>
  <li><p>jack</p></li>
  <li><p>jack</p></li>
  </ul>