From 213f0c273baafafa62a021617146d31d75593a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 12 Oct 2020 13:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Action.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"); + } }