Since the PHP process does not support multi-threading, for convenience and performance improvement in some scenarios, you can use PHP to implement multiple processes to make up for this shortcoming:
Foreach ($ cmds as $ cmd) {
$ pid = pcntl_FORK ();
IF ($ pid ==-1) {// Process creation failed
DIE ('FORK Child Process Failure !');
}
else if($pid){ //Parent process processing logic
pcntl_wait($status,WNOHANG);
}
else{ //Child process processing logic
pcntl_exec('/usr/local/bin/php',$cmd);
}
}