title: PHP: What does pcntl_fork() really do?
body: <p>PHP's pcntl_fork function is supposed to fork a process just as the standard fork function in C.<br>
  But I was wondering if this function really forks the process or if it emulates that behavior in a different way.<br>
  If it really forks the process then it's clear which process that is: one of Apache's child processes.<br>
  That's OK as long as Apache is using the prefork MPM (i.e. one process per request).<br>
  But what does happen if Apache is using the worker MPM??<br>
  When the worker MPM is being used, every Apache child process contains many threads, each one handling a different HTTP request. So if you would fork the process under that situation I can't even think what would happend to all those threads and requests being served.<br>
  So if pcntl_fork() really forks the process then I think it's not a good idea to use this function if you set Apache to use the worker MPM.</p>
  
  <p>What do the experts say? Am I reasoning well, or I'm just speaking nonsense?</p>