$pid = fork; if ($pid) { #This is the parent, continue processing } else { #this is the child, so exec #which will replace the child exec("echo HELLO WORLD"); }