<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.exec.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.proc-terminate.php',
    1 => 'proc_terminate',
    2 => 'Kills a process opened by proc_open',
  ),
  'up' => 
  array (
    0 => 'ref.exec.php',
    1 => 'Program execution Functions',
  ),
  'prev' => 
  array (
    0 => 'function.proc-open.php',
    1 => 'proc_open',
  ),
  'next' => 
  array (
    0 => 'function.shell-exec.php',
    1 => 'shell_exec',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/exec/functions/proc-terminate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.proc-terminate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">proc_terminate</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">proc_terminate</span> &mdash; <span class="dc-title">Kills a process opened by proc_open</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.proc-terminate-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>proc_terminate</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$process</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$signal</code><span class="initializer"> = 15</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Signals a <code class="parameter">process</code> (created using
   <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span>) that it should terminate.
   <span class="function"><strong>proc_terminate()</strong></span> returns immediately and does not wait
   for the process to terminate.
  </p>
  <p class="para">
   <span class="function"><strong>proc_terminate()</strong></span> allows you terminate the process and
   continue with other tasks.  You may poll the process (to see if it has
   stopped yet) by using the <span class="function"><a href="function.proc-get-status.php" class="function">proc_get_status()</a></span> function.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.proc-terminate-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">process</code></dt>
     <dd>
      <p class="para">
       The <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> that will
       be closed.
      </p>
     </dd>
    
    
     <dt><code class="parameter">signal</code></dt>
     <dd>
      <p class="para">
       This optional parameter is only useful on <abbr title="Portable Operating System Interface">POSIX</abbr>
       operating systems; you may specify a signal to send to the process
       using the <code class="literal">kill(2)</code> system call.  The default is
       <code class="literal">SIGTERM</code>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.proc-terminate-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the termination status of the process that was run.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.proc-terminate-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.proc-open.php" class="function" rel="rdfs-seeAlso">proc_open()</a> - Execute a command and open file pointers for input/output</span></li>
    <li><span class="function"><a href="function.proc-close.php" class="function" rel="rdfs-seeAlso">proc_close()</a> - Close a process opened by proc_open and return the exit code of that process</span></li>
    <li><span class="function"><a href="function.proc-get-status.php" class="function" rel="rdfs-seeAlso">proc_get_status()</a> - Get information about a process opened by proc_open</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>