title: how to use pcntl_fork() with Apache?
body: <p>This is my code, inside <code>index.php</code> (just an example):</p>
  
  <pre><code>$pid = pcntl_fork();
  if ($pid == -1) {
    die("failed to fork");
  } else if ($pid) {
    // nothing to do
  } else {
    putDataIntoWebService();
    exit();
  }
  echo "normal page content";
  </code></pre>
  
  <p>This snippet works fine in command line. In Apache <code>exit()</code> kills them both, the parent and the kid process. What is a workaround?</p>