Source of: /manual/en/function.proc-get-status.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-get-status.php',
1 => 'proc_get_status',
),
'up' =>
array (
0 => 'ref.exec.php',
1 => 'Program execution Functions',
),
'prev' =>
array (
0 => 'function.proc-close.php',
1 => 'proc_close',
),
'next' =>
array (
0 => 'function.proc-nice.php',
1 => 'proc_nice',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.proc-get-status" class="refentry">
<div class="refnamediv">
<h1 class="refname">proc_get_status</h1>
<p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">proc_get_status</span> — <span class="dc-title">Get information about a process opened by <a href="function.proc-open.php" class="function">proc_open()</a></span></p>
</div>
<a name="function.proc-get-status.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">array</span> <span class="methodname"><b>proc_get_status</b></span>
( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$process</tt></span>
)</div>
<p class="para rdfs-comment">
<b>proc_get_status()</b> fetches data about a
process opened using <a href="function.proc-open.php" class="function">proc_open()</a>.
</p>
</div>
<a name="function.proc-get-status.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 evaluated.
</p>
</dd>
</dl>
<p>
</p>
</div>
<a name="function.proc-get-status.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
An <a href="language.types.array.php" class="type array">array</a> of collected information on success, and <b><tt class="constant">FALSE</tt></b>
on failure. The returned array contains the following elements:
</p>
<p class="para">
</p><table class="doctable informaltable">
<thead valign="middle">
<tr valign="middle"><th>element</th><th>type</th><th>description</th></tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left">command</td>
<td align="left"><a href="language.types.string.php" class="type string">string</a></td>
<td align="left">
The command string that was passed to <a href="function.proc-open.php" class="function">proc_open()</a>.
</td>
</tr>
<tr valign="middle">
<td align="left">pid</td>
<td align="left"><a href="language.types.integer.php" class="type int">int</a></td>
<td align="left">process id</td>
</tr>
<tr valign="middle">
<td align="left">running</td>
<td align="left"><a href="language.types.boolean.php" class="type bool">bool</a></td>
<td align="left">
<b><tt class="constant">TRUE</tt></b> if the process is still running, <b><tt class="constant">FALSE</tt></b> if it has
terminated.
</td>
</tr>
<tr valign="middle">
<td align="left">signaled</td>
<td align="left"><a href="language.types.boolean.php" class="type bool">bool</a></td>
<td align="left">
<b><tt class="constant">TRUE</tt></b> if the child process has been terminated by
an uncaught signal. Always set to <b><tt class="constant">FALSE</tt></b> on Windows.
</td>
</tr>
<tr valign="middle">
<td align="left">stopped</td>
<td align="left"><a href="language.types.boolean.php" class="type bool">bool</a></td>
<td align="left">
<b><tt class="constant">TRUE</tt></b> if the child process has been stopped by a
signal. Always set to <b><tt class="constant">FALSE</tt></b> on Windows.
</td>
</tr>
<tr valign="middle">
<td align="left">exitcode</td>
<td align="left"><a href="language.types.integer.php" class="type int">int</a></td>
<td align="left">
The exit code returned by the process (which is only
meaningful if <i>running</i> is <b><tt class="constant">FALSE</tt></b>).
Only first call of this function return real value, next calls return
<i>-1</i>.
</td>
</tr>
<tr valign="middle">
<td align="left">termsig</td>
<td align="left"><a href="language.types.integer.php" class="type int">int</a></td>
<td align="left">
The number of the signal that caused the child process to terminate
its execution (only meaningful if <i>signaled</i> is <b><tt class="constant">TRUE</tt></b>).
</td>
</tr>
<tr valign="middle">
<td align="left">stopsig</td>
<td align="left"><a href="language.types.integer.php" class="type int">int</a></td>
<td align="left">
The number of the signal that caused the child process to stop its
execution (only meaningful if <i>stopped</i> is <b><tt class="constant">TRUE</tt></b>).
</td>
</tr>
</tbody>
</table>
<p>
</p>
</div>
<a name="function.proc-get-status.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>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>