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