title: Continue execution after calling php passthru() function
body: <p>When using php passthru() function, default is to stay until the external script execution ends.   </p>
  
  <p>PHP manual says ::::: "If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends." - <a href="http://php.net/manual/en/function.passthru.php" rel="nofollow">http://php.net/manual/en/function.passthru.php</a></p>
  
  <p>I want to collect external script data for specific time e.g. for 30 seconds, and after that continue the php script execution. Any ideas how to do that?</p>
  
  <p>My current code is: </p>
  
  <pre><code>    ob_start();
      passthru("/home/somefolder/somefolder2/program $pic1 $pic2");
      $details = ob_get_contents();
      ob_end_clean();
  </code></pre>
  
  <p>problem in above code is - sometimes "program" script keeps executing for a while, but i don't want to let the user to hang-on more than 30 seconds on this process.</p>
  
  <p>I thought about redirecting the output to a file and read it after 30 seconds(according to the manual). But i don't know how redirect the output to a file.</p>