Source of: /manual/en/function.proc-terminate.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = 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',
),
'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',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.proc-terminate" class="refentry">
<div class="refnamediv">
<h1 class="refname">proc_terminate</h1>
<p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">proc_terminate</span> — <span class="dc-title">Kills a process opened by proc_open</span></p>
</div>
<a name="function.proc-terminate.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><b>proc_terminate</b></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$process</tt></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$signal</tt><span class="initializer"> = 15</span></span>
] )</div>
<p class="para rdfs-comment">
Signals a <i><tt class="parameter">process</tt></i>
(created using
<a href="function.proc-open.php" class="function">proc_open()</a>) that it should terminate.
<b>proc_terminate()</b> returns immediately and does not wait
for the process to terminate.
</p>
<p class="para">
<b>proc_terminate()</b> 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 <a href="function.proc-get-status.php" class="function">proc_get_status()</a> function.
</p>
</div>
<a name="function.proc-terminate.parameters"></a><div class="refsect1 parameters">
<h3 class="title">Parameters</h3>
<p class="para">
</p><dl>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">process</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
The <a href="function.proc-open.php" class="function">proc_open()</a> <a href="language.types.resource.php" class="type resource">resource</a> that will
be closed.
</p>
</dd>
<dt class="varlistentry">
<span class="term"><i><tt class="parameter">signal</tt></i>
</span>
</dt><dd class="listitem">
<p class="para">
This optional parameter is only useful on <acronym title="Portable Operating System Interface">POSIX</acronym>
operating systems; you may specify a signal to send to the process
using the <i>kill(2)</i> system call. The default is
<i>SIGTERM</i>.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.proc-terminate.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns the termination status of the process that was run.
</p>
</div>
<a name="function.proc-terminate.changelog"></a><div class="refsect1 changelog">
<h3 class="title">Changelog</h3>
<p class="para">
</p><table class="doctable informaltable">
<thead valign="middle">
<tr valign="middle">
<th>Version</th>
<th>Description</th>
</tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left">5.2.2</td>
<td align="left">
Previous versions used to destroy the given process
<i><tt class="parameter">resource</tt></i>
.
</td>
</tr>
</tbody>
</table>
<p>
</p>
</div>
<a name="function.proc-terminate.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.proc-open.php" class="function" rel="rdfs-seeAlso">proc_open()</a> - Execute a command and open file pointers for input/output</li>
<li class="member"><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</li>
<li class="member"><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</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>