the parent process uses while (1) to suspend the process, and exit (1) is used in the child process, but in the end, ps-ef | grep php found that the child process did not exit. What caused the problem? normally, the child process should have exited?
<?php
for($i=0;$i<10;$iPP){
fork_worker();
}
function fork_worker(){
$pid = pcntl_fork();
if($pid == 0){ //child processes
echo "\r\n";
$this_id = getmypid();
echo $this_id."\r\n";
exit(1);
}elseif($pid > 0){ //master processes
echo "\r\n";
}
}
while(1);
?>
forget to answer questions