有没有办法只重新生成php子进程而无需重启php本身?

I'm running php-fpm and I'd like to shutdown and respawn php children without restarting php itself.

Actually, there is by using pcntl functions, pcntl_fork() in particular would be your friend for this..

You can find many code examples on this page.

Trivial example:

$pid = pcntl_fork();

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


// outputs:

child
parent

This is as simple as it gets, in real life you have a bit more to check for than this, do look at pcntl section on php.net, and a few of the code examples on the page I posted you. Hope that gets you on the right track, happy coding.