<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Executes specified program in current process space</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.pcntl-errno.html">pcntl_errno</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.pcntl-fork.html">pcntl_fork</a></div> <div class="up"><a href="ref.pcntl.html">PCNTL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.pcntl-exec" class="refentry"> <div class="refnamediv"> <h1 class="refname">pcntl_exec</h1> <p class="verinfo">(PHP 4 >= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">pcntl_exec</span> — <span class="dc-title">Executes specified program in current process space</span></p> </div> <div class="refsect1 description" id="refsect1-function.pcntl-exec-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>pcntl_exec</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span> [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code></span> [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$envs</code></span> ]] )</div> <p class="para rdfs-comment"> Executes the program with the given arguments. </p> </div> <div class="refsect1 parameters" id="refsect1-function.pcntl-exec-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">path</code></em></span> <dd> <p class="para"> <em><code class="parameter">path</code></em> must be the path to a binary executable or a script with a valid path pointing to an executable in the shebang ( #!/usr/local/bin/perl for example) as the first line. See your system's man execve(2) page for additional information. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">args</code></em></span> <dd> <p class="para"> <em><code class="parameter">args</code></em> is an array of argument strings passed to the program. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">envs</code></em></span> <dd> <p class="para"> <em><code class="parameter">envs</code></em> is an array of strings which are passed as environment to the program. The array is in the format of name => value, the key being the name of the environmental variable and the value being the value of that variable. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.pcntl-exec-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>FALSE</code></strong> on error and does not return on success. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.pcntl-errno.html">pcntl_errno</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.pcntl-fork.html">pcntl_fork</a></div> <div class="up"><a href="ref.pcntl.html">PCNTL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>