<p dir="auto">As of PHP bug <a href="https://bugs.php.net/bug.php?id=39992" rel="nofollow">https://bugs.php.net/bug.php?id=39992</a>, proc_terminate, used in Process.php @ line 555 does not terminate children process.</p>
<p dir="auto">I propose either use a fix described in <a href="http://php.net/manual/en/function.proc-terminate.php" rel="nofollow">http://php.net/manual/en/function.proc-terminate.php</a> , or grouping pids as "mast at imast dot ru" described in the php.net bug itself.</p>
<p dir="auto">Since PHP internally executes all commands using <code class="notranslate">sh -c "original cmd"</code> a call to <code class="notranslate">-&gt;stop()</code> does not actually stop our process, but instead stops <code class="notranslate">sh -c</code> while the real process can still continue running.</p>
<p dir="auto">I'm not sure what the best fix is here, we could add an <code class="notranslate">exec</code> call in front of the command to remove the <code class="notranslate">sh -c</code> wrapper and directly control our process.</p>
<p dir="auto">Another improvement in the stop() method would be to send a final <code class="notranslate">SIGKILL</code> signal if the process does not terminate after sending <code class="notranslate">SIGTERM</code>. But that would only make sense if we actually send this signal to the real process, not to the wrapper.</p>