Say I have a PHP script,
//main.php -> PID = 1002
<?php
exec('ProcessOne');
exec('ProcessTwo');
//... many other exec calls
?>
The main.php creates many other processes with their own pids which may not be recorded/tracked by the script, but the pid of main.php is known.
My question is: how do I kill all those processes created by main.php(including main.php) by only knowing the pid of main.php which is 1002 in my example?
The script should run in Linux.
Thanks