title: PHP - Kill proc_open() process on different file?
body: <p>I am creating a background process using <code>proc_open()</code> and am wondering how to cancel or stop this background process, from a different file or action, while my background process is still running?</p>
  
  <p>Here is my code :</p>
  
  <pre><code>$errorLog = './error.log';
  $descriptorspec = array(
      0 =&gt; array("pipe", "r"),  // stdin is a pipe that the child will read from
      1 =&gt; array("pipe", "w"),  // stdout is a pipe that the child will write to
      2 =&gt; array("file", $errorLog, "a") // stderr is a file to write to
  );
  proc_open("/var/bin/php /home/hello/myscript.php &amp;", $descriptorspec, $pipes);
  </code></pre>
  
  <p>I already read about <code>proc_terminate($process)</code> but it seems that requires the  returned by <code>proc_open()</code> to stop the process. Is there any way to stop it without having <code>proc_open()</code> in the same script?</p>