PHP - pcntl_fork() not running child process

194 Views Asked by At

I am running following code. It's only running parent process.

$pid = pcntl_fork();

if($pid) {
  // parent process runs what is here
  echo $pid;
  echo "parent\n";
}
else {
  // child process runs what is here
  echo "child\n";
}

Output: 1553172parent

I am unable to understand, Why is not running child process.

0

There are 0 best solutions below