title: PHP Pipe into a background process
body: <p>I'm trying to use popen to run a php script in the background. However, I need to pass a (fairly large) serialized object.</p>
  
  <pre><code>$cmd = "php background_test.php &gt;log/output.log &amp;";
  $fh = popen($cmd, 'w');
  fwrite($fh, $data); 
  fclose($fh);
  //pclose($fh);
  </code></pre>
  
  <p>Without the ampersand this code executes fine but the parent script will wait until the child is finished running. With the ampersand STDIN gets no data.</p>
  
  <p>Any ideas?</p>