Source of: /manual/en/install.unix.commandline.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/install.unix.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'install.unix.commandline.php',
1 => 'CGI and command line setups',
),
'up' =>
array (
0 => 'install.unix.php',
1 => 'Installation on Unix systems',
),
'prev' =>
array (
0 => 'install.unix.sun.php',
1 => 'Sun, iPlanet and Netscape servers on Sun Solaris',
),
'next' =>
array (
0 => 'install.unix.hpux.php',
1 => 'HP-UX specific installation notes',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="install.unix.commandline" class="sect1">
<h2 class="title">CGI and command line setups</h2>
<p class="para">
The default is to build PHP as a CGI program. This creates a
command line interpreter, which can be used for CGI processing, or
for non-web-related PHP scripting. If you are running a web
server PHP has module support for, you should generally go for
that solution for performance reasons. However, the CGI version
enables users to run different PHP-enabled pages under
different user-ids.
</p>
<div class="warning"><b class="warning">Warning</b><p class="para">A server deployed in CGI mode is open
to several possible vulnerabilities. Please read our
<a href="security.cgi-bin.php" class="link">CGI security section</a> to learn how to
defend yourself from such attacks.</p></div>
<p class="para">
As of PHP 4.3.0, some important additions have happened to PHP. A new
SAPI named CLI also exists and it has the same name as the CGI binary.
What is installed at <i>{PREFIX}/bin/php</i> depends on your
configure line and this is described in detail in the manual section
named <a href="features.commandline.php" class="link">Using PHP from the command
line</a>. For further details please read that section of the manual.
</p>
<div id="install.unix.commandline.testing" class="sect2">
<h3 class="title">Testing</h3>
<p class="simpara">
If you have built PHP as a CGI program, you may test your build
by typing <strong class="command">make test</strong>. It is always a good idea
to test your build. This way you may catch a problem with PHP on
your platform early instead of having to struggle with it later.
</p>
</div>
<div id="install.unix.commandline.using-variables" class="sect2">
<h3 class="title">Using Variables</h3>
<p class="simpara">
Some <a href="reserved.variables.server.php" class="link">server supplied
environment variables</a> are not defined in the
current <a href="http://hoohoo.ncsa.uiuc.edu/cgi/env.html" class="link external">» CGI/1.1 specification</a>.
Only the following variables are defined there: <var class="varname">AUTH_TYPE</var>,
<var class="varname">CONTENT_LENGTH</var>, <var class="varname">CONTENT_TYPE</var>,
<var class="varname">GATEWAY_INTERFACE</var>, <var class="varname">PATH_INFO</var>,
<var class="varname">PATH_TRANSLATED</var>, <var class="varname">QUERY_STRING</var>,
<var class="varname">REMOTE_ADDR</var>, <var class="varname">REMOTE_HOST</var>,
<var class="varname">REMOTE_IDENT</var>, <var class="varname">REMOTE_USER</var>,
<var class="varname">REQUEST_METHOD</var>, <var class="varname">SCRIPT_NAME</var>,
<var class="varname">SERVER_NAME</var>, <var class="varname">SERVER_PORT</var>,
<var class="varname">SERVER_PROTOCOL</var>, and <var class="varname">SERVER_SOFTWARE</var>.
Everything else should be treated as 'vendor extensions'.
</p>
</div>
</div><?php manual_footer(); ?>