<HTML ><HEAD ><TITLE >Servers-CGI/Commandline</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Installation" HREF="installation.html"><LINK REL="PREVIOUS" TITLE="Installation on Windows systems" HREF="install.windows.html"><LINK REL="NEXT" TITLE="Servers-Apache" HREF="install.apache.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="install.windows.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 3. Installation</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="install.apache.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="install.commandline" ></A >Servers-CGI/Commandline</H1 ><P > The default is to build PHP as a CGI program. This creates a commandline 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 Apache users to run different PHP-enabled pages under different user-ids. Please make sure you read through the <A HREF="security.html" >Security chapter</A > if you are going to run PHP as a CGI. </P ><P > 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 <TT CLASS="literal" >{PREFIX}/bin/php</TT > depends on your configure line and this is described in detail in the manual section named <A HREF="features.commandline.html" >Using PHP from the command line</A >. For further details please read that section of the manual. </P ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="install.commandline.testing" ></A >Testing</H2 ><P > If you have built PHP as a CGI program, you may test your build by typing <B CLASS="command" >make test</B >. 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 CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="install.commandline.benchmarking" ></A >Benchmarking</H2 ><P > If you have built PHP 3 as a CGI program, you may benchmark your build by typing <B CLASS="command" >make bench</B >. Note that if <A HREF="features.safe-mode.html" >Safe Mode</A > is on by default, the benchmark may not be able to finish if it takes longer then the 30 seconds allowed. This is because the <A HREF="function.set-time-limit.html" ><B CLASS="function" >set_time_limit()</B ></A > can not be used in safe mode. Use the <A HREF="ref.info.html#ini.max-execution-time" >max_execution_time</A > configuration setting to control this time for your own scripts. <B CLASS="command" >make bench</B > ignores the <A HREF="configuration.html#configuration.file" >configuration file</A >. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > <B CLASS="command" >make bench</B > is only available for PHP 3. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="install.commandline.using-variables" ></A >Using Variables</H2 ><P > Some server supplied enviroment variables are not defined in the current <A HREF="http://hoohoo.ncsa.uiuc.edu/cgi/env.html" TARGET="_top" >CGI/1.1 specification</A >. Only the following variables are defined there; everything else should be treated as 'vendor extensions': AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD, SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PROTOCOL and SERVER_SOFTWARE </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="install.windows.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="install.apache.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Installation on Windows systems</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="installation.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Servers-Apache</TD ></TR ></TABLE ></DIV ></BODY ></HTML >