Tell Me How
Tell Me How

Reputation: 570

PHP - pcntl_fork() not running child process

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.

Upvotes: 1

Views: 191

Answers (0)

Related Questions