diff --git a/HttpServer/Action.php b/HttpServer/Action.php index 15731024..d332fd8f 100644 --- a/HttpServer/Action.php +++ b/HttpServer/Action.php @@ -125,7 +125,10 @@ trait Action */ private function closeByPid($pid) { - shell_exec('kill -TERM ' . $pid); + exec("ps -ef $pid | grep $pid", $output); + if (!empty($output)) { + exec("kill -TERM $pid"); + } }