in reply to How to kill an external program
if($pid = fork() == 0) { exec("command"); } # this is all executed in the parent ... kill $pid; [download]