I have the most basic script:
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} else if ($pid) {
// we are the parent
echo "parent done";
pcntl_wait($status); //Protect against Zombie children
echo "all done";
} else {
// we are the child
echo "Child finished";
}
When I run this, the output is always "Child finished". I'm running this on a lighttpd server.