This is a MIME encoded message
goba Tue Jun 8 17:47:58 2004 EDT
Added files: /phpdoc/en/install ini.xml /phpdoc/en/install/unix apache1.xml apache2.xml caudium.xml commandline.xml fhttpd.xml hpux.xml index.xml openbsd.xml solaris.xml sun.xml Log: Unix part (see status report mail on mailing list); also adding a copy of the config section (ini.xml) here
http://cvs.php.net/co.php/phpdoc/en/install/ini.xml?r=1.1&p=1 Index: phpdoc/en/install/ini.xml +++ phpdoc/en/install/ini.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <chapter id="configuration"> <title>Runtime Configuration</title> <sect1 id="configuration.file"> <title>The configuration file</title> <simpara> The configuration file (called <filename>php3.ini</filename> in PHP 3, and simply &php.ini; as of PHP 4) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the <acronym>CGI</acronym> and <acronym>CLI</acronym> version, it happens on every invocation. </simpara> <para> The default location of &php.ini; is a compile time option (see the <link linkend="faq.installation.phpini">FAQ</link> entry), but can be changed for the <acronym>CGI</acronym> and <acronym>CLI</acronym> version with the <literal>-c</literal> command line switch, see the chapter about using PHP from the <link linkend="features.commandline">command line</link>. You can also use the environment variable <varname>PHPRC</varname> for an additional path to search for a &php.ini; file. </para> <note> <para> The Apache web server changes the directory to root at startup causing PHP to attempt to read &php.ini; from the root filesystem if it exists. </para> </note> <para> The &php.ini; directives handled by extensions are documented respectively on the pages of the extensions themselfs. The <link linkend="ini">list of the core directives</link> is available in the appendix. Probably not all the PHP directives are documented in the manual though. For a completel list of directives available in your PHP version, please read your well commented &php.ini; file. Alternatively, you may find the <ulink url="&url.php.cvs.phpini;">the latest &php.ini;</ulink> from CVS helpful too. </para> <para> <example> <title>&php.ini; example</title> <programlisting role="ini"> <![CDATA[ ; any text on a line after an unquoted semicolon (;) is ignored [php] ; section markers (text within square brackets) are also ignored ; Boolean values can be set to either: ; true, on, yes ; or false, off, no, none register_globals = off track_errors = yes ; you can enclose strings in double-quotes include_path = ".:/usr/local/lib/php" ; backslashes are treated the same as any other character include_path = ".;c:\php\lib" ]]> </programlisting> <!-- TODO: add more details about values and expressions --> </example> </para> </sect1> <sect1 id="configuration.changes"> <title>How to change configuration settings</title> <sect2 id="configuration.changes.apache"> <title>Running PHP as an Apache module</title> <simpara> When using PHP as an Apache module, you can also change the configuration settings using directives in Apache configuration files (e.g. &httpd.conf;) and &htaccess; files. You will need "AllowOverride Options" or "AllowOverride All" privileges to do so. </simpara> <para> With PHP 4 and PHP 5, there are several Apache directives that allow you to change the PHP configuration from within the Apache configuration files. For a listing of which directives are <constant>PHP_INI_ALL</constant>, <constant>PHP_INI_PERDIR</constant>, or <constant>PHP_INI_SYSTEM</constant>, have a look at the table found within the <function>ini_set</function> documentation. </para> <note> <simpara> With PHP 3, there are Apache directives that correspond to each configuration setting in the <filename>php3.ini</filename> name, except the name is prefixed by "php3_". </simpara> </note> <para> <variablelist> <varlistentry> <term> <systemitem role="directive">php_value</systemitem> <parameter>name</parameter> <parameter>value</parameter> </term> <listitem> <para> Sets the value of the specified directive. Can be used only with <constant>PHP_INI_ALL</constant> and <constant>PHP_INI_PERDIR</constant> type directives. To clear a previously set value use <literal>none</literal> as the value. </para> <note> <simpara> Don't use <systemitem role="directive">php_value</systemitem> to set boolean values. <systemitem role="directive">php_flag</systemitem> (see below) should be used instead. </simpara> </note> </listitem> </varlistentry> <varlistentry> <term> <systemitem role="directive">php_flag</systemitem> <parameter>name</parameter> <parameter>on|off</parameter> </term> <listitem> <para> Used to set a boolean configuration directive. Can be used only with <constant>PHP_INI_ALL</constant> and <constant>PHP_INI_PERDIR</constant> type directives. </para> </listitem> </varlistentry> <varlistentry> <term> <systemitem role="directive">php_admin_value</systemitem> <parameter>name</parameter> <parameter>value</parameter> </term> <listitem> <para> Sets the value of the specified directive. This <emphasis>can not be used</emphasis> in &htaccess; files. Any directive type set with <systemitem role="directive">php_admin_value</systemitem> can not be overridden by &htaccess; or virtualhost directives. To clear a previously set value use <literal>none</literal> as the value. </para> </listitem> </varlistentry> <varlistentry> <term> <systemitem role="directive">php_admin_flag</systemitem> <parameter>name</parameter> <parameter>on|off</parameter> </term> <listitem> <para> Used to set a boolean configuration directive. This <emphasis>can not be used</emphasis> in &htaccess; files. Any directive type set with <systemitem role="directive">php_admin_flag</systemitem> can not be overridden by &htaccess; or virtualhost directives. </para> </listitem> </varlistentry> </variablelist> </para> <para> <example> <title>Apache configuration example</title> <programlisting role="ini"> <![CDATA[ <IfModule mod_php5.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag safe_mode on </IfModule> <IfModule mod_php4.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag safe_mode on </IfModule> <IfModule mod_php3.c> php3_include_path ".:/usr/local/lib/php" php3_safe_mode on </IfModule> ]]> </programlisting> </example> </para> <caution> <para> PHP constants do not exist outside of PHP. For example, in &httpd.conf; you can not use PHP constants such as <constant>E_ALL</constant> or <constant>E_NOTICE</constant> to set the <link linkend="ini.error-reporting">error_reporting</link> directive as they will have no meaning and will evaluate to <emphasis>0</emphasis>. Use the associated bitmask values instead. These constants can be used in &php.ini; </para> </caution> </sect2> <sect2 id="configuration.changes.windows"> <title>Changing PHP configuration via the Windows registry</title> <simpara> When running PHP on Windows, the configuration values can be modified on a per-directory basis using the Windows registry. The configuration values are stored in the registry key <literal>HKLM\SOFTWARE\PHP\Per Directory Values</literal>, in the sub-keys corresponding to the path names. For example, configuration values for the directory <literal>c:\inetpub\wwwroot</literal> would be stored in the key <literal>HKLM\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot</literal>. The settings for the directory would be active for any script running from this directory or any subdirectory of it. The values under the key should have the name of the PHP configuration directive and the string value. PHP constants in the values are not parsed. </simpara> </sect2> <sect2 id="configuration.changes.other"> <title>Other interfaces to PHP</title> <para> Regardless of how you run PHP, you can change certain values at runtime of your scripts through <function>ini_set</function>. See the documentation on the <function>ini_set</function> page for more information. </para> <para> If you are interested in a complete list of configuration settings on your system with their current values, you can execute the <function>phpinfo</function> function, and review the resulting page. You can also access the values of individual configuration directives at runtime using <function>ini_get</function> or <function>get_cfg_var</function>. </para> </sect2> </sect1> </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/apache1.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/apache1.xml +++ phpdoc/en/install/unix/apache1.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.apache"> <title>Apache 1.3.x on Unix systems</title> <para> This section contains notes and hints specific to Apache installs of PHP on Unix platforms. We also have <link linkend="install.unix.apache2">instructions and notes for Apache 2 on a separate page</link>. </para> <para> You can select arguments to add to the <command>configure</command> on line 10 below from the <link linkend="configure">list of core configure options</link> and from extension specific options described at the respective places in the manual. The version numbers have been omitted here, to ensure the instructions are not incorrect. You will need to replace the 'xxx' here with the correct values from your files. </para> <example id="install.unix.apache.example"> <title> Installation Instructions (Apache Shared Module Version) for PHP </title> <screen> <![CDATA[ 1. gunzip apache_xxx.tar.gz 2. tar -xvf apache_xxx.tar 3. gunzip php-xxx.tar.gz 4. tar -xvf php-xxx.tar 5. cd apache_xxx 6. ./configure --prefix=/www --enable-module=so 7. make 8. make install 9. cd ../php-xxx 10. Now, configure your PHP. This is where you customize your PHP with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 1 and MySQL support. Your path to apxs may differ from our example. ./configure --with-mysql --with-apxs=/www/bin/apxs 11. make 12. make install If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed. Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more. 13. Setup your php.ini file: cp php.ini-dist /usr/local/lib/php.ini You may edit your .ini file to set PHP options. If you prefer your php.ini in another location, use --with-config-file-path=/some/path in step 10. If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves. 14. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. For PHP 4: LoadModule php4_module libexec/libphp4.so For PHP 5: LoadModule php5_module libexec/libphp5.so 15. And in the AddModule section of httpd.conf, somewhere under the ClearModuleList, add this: For PHP 4: AddModule mod_php4.c For PHP 5: AddModule mod_php5.c 16. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could have any extension(s) parse as PHP by simply adding more, with each separated by a space. We'll add .phtml to demonstrate. AddType application/x-httpd-php .php .phtml It's also common to setup the .phps extension to show highlighted PHP source, this can be done with: AddType application/x-httpd-php-source .phps 17. Use your normal procedure for starting the Apache server. (You must stop and restart the server, not just cause the server to reload by using a HUP or USR1 signal.) ]]> </screen> </example> <para> Depending on your Apache install and Unix variant, there are many possible ways to stop and restart the server. Below are some typical lines used in restarting the server, for different apache/unix installations. You should replace <literal>/path/to/</literal> with the path to these applications on your systems. </para> <para> <example> <title>Example commands for restarting Apache</title> <programlisting role="shell"> <![CDATA[ 1. Several Linux and SysV variants: /etc/rc.d/init.d/httpd restart 2. Using apachectl scripts: /path/to/apachectl stop /path/to/apachectl start 3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl: /path/to/httpsdctl stop /path/to/httpsdctl start 4. Using mod_ssl, or another SSL server, you may want to manually stop and start: /path/to/apachectl stop /path/to/apachectl startssl ]]> </programlisting> </example> </para> <para> The locations of the apachectl and http(s)dctl binaries often vary. If your system has <literal>locate</literal> or <literal>whereis</literal> or <literal>which</literal> commands, these can assist you in finding your server control programs. </para> <para> Different examples of compiling PHP for apache are as follows: <informalexample> <programlisting role="shell"> <![CDATA[ /configure --with-apxs --with-pgsql ]]> </programlisting> </informalexample> </para> <para> This will create a <filename>libphp4.so</filename> shared library that is loaded into Apache using a LoadModule line in Apache's &httpd.conf; file. The PostgreSQL support is embedded into this <filename>libphp4.so</filename> library. </para> <para> <informalexample> <programlisting role="shell"> <![CDATA[ /configure --with-apxs --with-pgsql=shared ]]> </programlisting> </informalexample> </para> <para> This will create a <filename>libphp4.so</filename> shared library for Apache, but it will also create a <filename>pgsql.so</filename> shared library that is loaded into PHP either by using the extension directive in &php.ini; file or by loading it explicitly in a script using the <function>dl</function> function. </para> <para> <informalexample> <programlisting role="shell"> <![CDATA[ /configure --with-apache=/path/to/apache_source --with-pgsql ]]> </programlisting> </informalexample> </para> <para> This will create a <filename>libmodphp4.a</filename> library, a <filename>mod_php4.c</filename> and some accompanying files and copy this into the <literal>src/modules/php4</literal> directory in the Apache source tree. Then you compile Apache using <literal>--activate-module=src/modules/php4/libphp4.a</literal> and the Apache build system will create <filename>libphp4.a</filename> and link it statically into the <filename>httpd</filename> binary. The PostgreSQL support is included directly into this <filename>httpd</filename> binary, so the final result here is a single <filename>httpd</filename> binary that includes all of Apache and all of PHP. </para> <para> <informalexample> <programlisting role="shell"> <![CDATA[ /configure --with-apache=/path/to/apache_source --with-pgsql=shared ]]> </programlisting> </informalexample> </para> <para> Same as before, except instead of including PostgreSQL support directly into the final <filename>httpd</filename> you will get a <filename>pgsql.so</filename> shared library that you can load into PHP from either the &php.ini; file or directly using <function>dl</function>. </para> <para> When choosing to build PHP in different ways, you should consider the advantages and drawbacks of each method. Building as a shared object will mean that you can compile apache separately, and don't have to recompile everything as you add to, or change, PHP. Building PHP into apache (static method) means that PHP will load and run faster. For more information, see the Apache <ulink url="&url.apachedso;">webpage on DSO support</ulink>. </para> <note> <para> Apache's default &httpd.conf; currently ships with a section that looks like this: <informalexample> <programlisting role="apache-conf"> <![CDATA[ User nobody Group "#-1" ]]> </programlisting> </informalexample> Unless you change that to "Group nogroup" or something like that ("Group daemon" is also very common) PHP will not be able to open files. </para> </note> <note> <para> Make sure you specify the installed version of apxs when using <option role="configure">--with-apxs=/path/to/apxs</option>. You must NOT use the apxs version that is in the apache sources but the one that is actually installed on your system. </para> </note> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/apache2.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/apache2.xml +++ phpdoc/en/install/unix/apache2.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.apache2"> <title>Apache 2.0 on Unix systems</title> <para> This section contains notes and hints specific to Apache 2.0 installs of PHP on Unix systems. </para> &warn.apache2.compat; <para> You are highly encouraged to take a look at the <ulink url="&url.apache2.docs;">Apache Documentation</ulink> to get a basic understanding of the Apache 2.0 Server. </para> &install.snippet.apache2.compat; <para> Download the most recent version of <ulink url= "&url.apache;"> Apache 2.0</ulink> and a fitting PHP version from the above mentioned places. This quick guide covers only the basics to get started with Apache 2.0 and PHP. For more information read the <ulink url="&url.apache2.docs;">Apache Documentation</ulink>. The version numbers have been omitted here, to ensure the instructions are not incorrect. You will need to replace the 'NN' here with the correct values from your files. </para> <example> <title> Installation Instructions (Apache 2 Shared Module Version) </title> <screen> <![CDATA[ 1. gzip -d httpd-2_0_NN.tar.gz 2. tar xvf httpd-2_0_NN.tar 3. gunzip php-NN.tar.gz 4. tar -xvf php-NN.tar 5. cd httpd-2_0_NN 6. ./configure --enable-so 7. make 8. make install Now you have Apache 2.0.NN available under /usr/local/apache2, configured with loadable module support and the standard MPM prefork. To test the installation use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start and stop the server to go on with the configuration for PHP: /usr/local/apache2/bin/apachectl stop. 9. cd ../php-NN 10. Now, configure your PHP. This is where you customize your PHP with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 2 and MySQL support. Your path to apxs may differ, in fact, the binary may even be named apxs2 on your system. ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql 11. make 12. make install If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed. Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more. 13. Setup your php.ini cp php.ini-dist /usr/local/lib/php.ini You may edit your .ini file to set PHP options. If you prefer having php.ini in another location, use --with-config-file-path=/some/path in step 10. If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves. 14. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. For PHP 4: LoadModule php4_module libexec/libphp4.so For PHP 5: LoadModule php5_module libexec/libphp5.so 15. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could have any extension(s) parse as PHP by simply adding more, with each separated by a space. We'll add .phtml to demonstrate. AddType application/x-httpd-php .php .phtml It's also common to setup the .phps extension to show highlighted PHP source, this can be done with: AddType application/x-httpd-php-source .phps 16. Use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start ]]> </screen> </example> <para> Following the steps above you will have a running Apache 2.0 with support for PHP as <literal>SAPI</literal> module. Of course there are many more configuration options available for both, Apache and PHP. For more information use <command>./configure --help</command> in the corresponding source tree. In case you wish to build a multithreaded version of Apache 2.0 you must overwrite the standard MPM-Module <filename>prefork</filename> either with <filename>worker</filename> or <filename>perchild</filename>. To do so append to your configure line in step 6 above either the option <option role="configure">--with-mpm=worker</option> or <option role="configure">--with-mpm=perchild</option>. Take care about the consequences and understand what you are doing. For more information read the Apache documentation about the <ulink url="&url.apache2.mpm;"> MPM-Modules</ulink>. </para> <note> <para> To build a multithreaded version of Apache your system must support threads. This also implies to build PHP with experimental Zend Thread Safety (ZTS). Therefore not all extensions might be available. The recommended setup is to build Apache with the standard <filename>prefork</filename> MPM-Module. </para> </note> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/caudium.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/caudium.xml +++ phpdoc/en/install/unix/caudium.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.caudium"> <title>Caudium</title> <para> PHP 4 can be built as a Pike module for the <ulink url="&url.caudium;">Caudium webserver</ulink>. Note that this is not supported with PHP 3. Follow the simple instructions below to install PHP 4 for Caudium. </para> <example id="install.unix.caudium.instructions"> <title>Caudium Installation Instructions</title> <screen> <![CDATA[ 1. Make sure you have Caudium installed prior to attempting to install PHP 4. For PHP 4 to work correctly, you will need Pike 7.0.268 or newer. For the sake of this example we assume that Caudium is installed in /opt/caudium/server/. 2. Change directory to php-x.y.z (where x.y.z is the version number). 3. ./configure --with-caudium=/opt/caudium/server 4. make 5. make install 6. Restart Caudium if it's currently running. 7. Log into the graphical configuration interface and go to the virtual server where you want to add PHP 4 support. 8. Click Add Module and locate and then add the PHP 4 Script Support module. 9. If the documentation says that the 'PHP 4 interpreter isn't available', make sure that you restarted the server. If you did check /opt/caudium/logs/debug/default.1 for any errors related to <filename>PHP4.so</filename>. Also make sure that <filename>caudium/server/lib/[pike-version]/PHP4.so</filename> is present. 10. Configure the PHP Script Support module if needed. ]]> </screen> </example> <para> You can of course compile your Caudium module with support for the various extensions available in PHP 4. See the reference pages for extension specific configure options. </para> <note> <para> When compiling PHP 4 with MySQL support you must make sure that the normal MySQL client code is used. Otherwise there might be conflicts if your Pike already has MySQL support. You do this by specifying a MySQL install directory the <option role="configure">--with-mysql</option> option. </para> </note> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/commandline.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/commandline.xml +++ phpdoc/en/install/unix/commandline.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.commandline"> <title>CGI and commandline setups</title> <para> 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 users to run different PHP-enabled pages under different user-ids. Please make sure you read through the <link linkend="security.index">Security chapter</link> if you are going to run PHP as a CGI. </para> <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 <literal>{PREFIX}/bin/php</literal> depends on your configure line and this is described in detail in the manual section named <link linkend="features.commandline">Using PHP from the command line</link>. For further details please read that section of the manual. </para> <sect2 id="install.unix.commandline.testing"> <title>Testing</title> <simpara> If you have built PHP as a CGI program, you may test your build by typing <command>make test</command>. 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. </simpara> </sect2> <sect2 id="install.unix.commandline.benchmarking"> <title>Benchmarking</title> <simpara> If you have built PHP 3 as a CGI program, you may benchmark your build by typing <command>make bench</command>. Note that if &safemode; 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 <function>set_time_limit</function> can not be used in &safemode;. Use the <link linkend="ini.max-execution-time">max_execution_time</link> configuration setting to control this time for your own scripts. <command>make bench</command> ignores the <link linkend="configuration.file">configuration file</link>. </simpara> <note> <simpara> <command>make bench</command> is only available for PHP 3. </simpara> </note> </sect2> <sect2 id="install.unix.commandline.using-variables"> <title>Using Variables</title> <simpara> Some <link linkend="reserved.variables.server">server supplied environment variables</link> are not defined in the current <ulink url="&url.cgispec;">CGI/1.1 specification</ulink>. Only the following variables are defined there: <varname>AUTH_TYPE</varname>, <varname>CONTENT_LENGTH</varname>, <varname>CONTENT_TYPE</varname>, <varname>GATEWAY_INTERFACE</varname>, <varname>PATH_INFO</varname>, <varname>PATH_TRANSLATED</varname>, <varname>QUERY_STRING</varname>, <varname>REMOTE_ADDR</varname>, <varname>REMOTE_HOST</varname>, <varname>REMOTE_IDENT</varname>, <varname>REMOTE_USER</varname>, <varname>REQUEST_METHOD</varname>, <varname>SCRIPT_NAME</varname>, <varname>SERVER_NAME</varname>, <varname>SERVER_PORT</varname>, <varname>SERVER_PROTOCOL</varname>, and <varname>SERVER_SOFTWARE</varname>. Everything else should be treated as 'vendor extensions'. </simpara> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/fhttpd.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/fhttpd.xml +++ phpdoc/en/install/unix/fhttpd.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.fhttpd"> <title>fhttpd related notes</title> <para> To build PHP as an fhttpd module, answer "yes" to "Build as an fhttpd module?" (the <link linkend="install.configure.with-fhttpd"> --with-fhttpd</link>=<replaceable>DIR</replaceable> option to configure) and specify the fhttpd source base directory. The default directory is <filename class="directory">/usr/local/src/fhttpd</filename>. If you are running fhttpd, building PHP as a module will give better performance, more control and remote execution capability. </para> <note> <simpara> Support for fhttpd is no longer available as of PHP 4.3.0. </simpara> </note> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/hpux.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/hpux.xml +++ phpdoc/en/install/unix/hpux.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.hpux"> <title>HP-UX specific installation notes</title> <para> This section contains notes and hints specific to installing PHP on HP-UX systems. (Contributed by paul_mckay at clearwater-it dot co dot uk). </para> <note> <simpara> These tips were written for PHP 4.0.4 and Apache 1.3.9. </simpara> </note> <para> <orderedlist> <listitem> <para> You need gzip, download a binary distribution from <filename>http://hpux.connect.org.uk/ftp/hpux/Gnu/gzip-1.2.4a/gzip-1.2.4a-sd-10.20.depot.Z</filename> uncompress the file and install using swinstall. </para> </listitem> <listitem> <para> You need gcc, download a binary distribution from <filename>http://gatekeep.cs.utah.edu/ftp/hpux/Gnu/gcc-2.95.2/gcc-2.95.2-sd-10.20.depot.gz</filename>. uncompress this file and install gcc using swinstall. </para> </listitem> <listitem> <para> You need the GNU binutils, you can download a binary distribution from <filename>http://hpux.connect.org.uk/ftp/hpux/Gnu/binutils-2.9.1/binutils-2.9.1-sd-10.20.depot.gz</filename>. uncompress this file and install binutils using swinstall. </para> </listitem> <listitem> <para> You now need bison, you can download a binary distribution from <filename>http://hpux.connect.org.uk/ftp/hpux/Gnu/bison-1.28/bison-1.28-sd-10.20.depot.gz</filename>, install as above. </para> </listitem> <listitem> <para> You now need flex, you need to download the source from one of the http://www.gnu.org mirrors. It is in the non-gnu directory of the ftp site. Download the file, <command>gunzip</command>, then <command>tar -xvf</command> it. Go into the newly created flex directory and run <command>./configure</command>, followed by <command>make</command>, and then <command>make install</command>. </para> <para> If you have errors here, it's probably because gcc etc. are not in your PATH so add them to your PATH. </para> </listitem> <listitem> <para> Download the PHP and apache sources. </para> </listitem> <listitem> <para> <command>gunzip</command> and <command>tar -xvf</command> them. We need to hack a couple of files so that they can compile OK. </para> </listitem> <listitem> <para> Firstly the configure file needs to be hacked because it seems to lose track of the fact that you are a hpux machine, there will be a better way of doing this but a cheap and cheerful hack is to put <literal>lt_target=hpux10.20</literal> on line 47286 of the configure script. </para> </listitem> <listitem> <para> Next, the Apache GuessOS file needs to be hacked. Under <filename>apache_1.3.9/src/helpers</filename> change line 89 from <literal>echo "hp${HPUXMACH}-hpux${HPUXVER}"; exit 0</literal> to: <literal>echo "hp${HPUXMACH}-hp-hpux${HPUXVER}"; exit 0</literal> </para> </listitem> <listitem> <para> You cannot install PHP as a shared object under HP-UX so you must compile it as a static, just follow the instructions at the Apache page. </para> </listitem> <listitem> <para> PHP and Apache should have compiled OK, but Apache won't start. you need to create a new user for Apache, e.g. www, or apache. You then change lines 252 and 253 of the <filename>conf/httpd.conf</filename> in Apache so that instead of </para> <screen> User nobody Group nogroup </screen> <para> you have something like </para> <screen> User www Group sys </screen> <para> This is because you can't run Apache as nobody under hp-ux. Apache and PHP should then work. </para> </listitem> </orderedlist> </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/index.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/index.xml +++ phpdoc/en/install/unix/index.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <chapter id="install.unix"> <title>Installation on Unix systems</title> <para> This section will guide you through the general configuration and installation of PHP on Unix systems. Be sure to investigate any sections specific to your platform or web server before you begin the process. </para> <para> As our manual outlines in the <link linkend="install.general">General Installation Considerations</link> section, we are mainly dealing with web centric setups of PHP in this section, although we will cover setting up PHP for command line usage as well. </para> <para> There are several ways to install PHP for the Unix platform, either with a compile and configure process, or through various pre-packaged methods. This documentation is mainly focused around the process of compiling and configuring PHP. Many Unix like systems have some sort of package installation system. This can assist in setting up a standard configuration, but if you need to have a different set of features (such as a secure server, or a different database driver), you may need to build PHP and/or your webserver. If you are unfamiliar with building and compiling your own software, it is worth checking to see whether somebody has already built a packaged version of PHP with the features you need. </para> <para> Prerequisite knowledge and software for compiling: <itemizedlist> <listitem> <simpara> Basic Unix skills (being able to operate "make" and a C compiler) </simpara> </listitem> <listitem> <simpara> An ANSI C compiler </simpara> </listitem> <listitem> <simpara> flex </simpara> </listitem> <listitem> <simpara> bison </simpara> </listitem> <listitem> <simpara> A web server </simpara> </listitem> <listitem> <simpara> Any module specific components (such as gd, pdf libs, etc.) </simpara> </listitem> </itemizedlist> </para> <para> The initial PHP setup and configuration process is controlled by the use of the commandline options of the <filename>configure</filename> script. Our manual documents the different options separately. You will find the <link linkend="configure">core options in the appendix</link>, while the different extension specific options are descibed on the reference pages. </para> <para> When PHP is configured, you are ready to build the module and/or executables. The command <command>make</command> should take care of this. If it fails and you can't figure out why, see the <link linkend="install.problems">Problems section</link>. </para> &install.unix.hpux; &install.unix.openbsd; &install.unix.solaris; &install.unix.apache1; &install.unix.apache2; &install.unix.caudium; &install.unix.fhttpd; &install.unix.sun; &install.unix.commandline; </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/openbsd.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/openbsd.xml +++ phpdoc/en/install/unix/openbsd.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.openbsd"> <title>OpenBSD installation notes</title> <para> This section contains notes and hints specific to installing PHP on <ulink url="&url.openbsd;">OpenBSD 3.4</ulink>. </para> <sect2 id="install.unix.openbsd.packages"> <title>Using Binary Packages</title> <simpara> Using binary packages to install PHP on OpenBSD is the recommended and simplest method. The core package has been separated from the various modules, and each can be installed and removed independently from the others. The files you need can be found on your OpenBSD CD or on the FTP site. </simpara> <simpara> The main package you need to install is <filename>php4-core-4.3.3.tgz</filename>, which contains the basic engine (plus gettext and iconv). Next, take a look at the module packages, such as <filename>php4-mysql-4.3.3.tgz</filename> or <filename>php4-imap-4.3.3.tgz</filename>. You need to use the <command>phpxs</command> command to activate and deactivate these modules in your &php.ini;. </simpara> <example id="install.unix.openbsd.ports.example"> <title>OpenBSD Package Install Example</title> <programlisting role="shell"> <![CDATA[ # pkg_add php4-core-4.3.3.tgz # /usr/local/sbin/phpxs -s # cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini (add in mysql) # pkg_add php4-mysql-4.3.3.tgz # /usr/local/sbin/phpxs -a mysql (add in imap) # pkg_add php4-imap-4.3.3.tgz # /usr/local/sbin/phpxs -a imap (remove mysql as a test) # pkg_delete php4-mysql-4.3.3 # /usr/local/sbin/phpxs -r mysql (install the PEAR libraries) # pkg_add php4-pear-4.3.3.tgz ]]> </programlisting> </example> <simpara> Read the <ulink url="&url.openbsd.packages;">packages(7)</ulink> manual page for more information about binary packages on OpenBSD. </simpara> </sect2> <sect2 id="install.unix.openbsd.ports"> <title>Using Ports</title> <simpara> You can also compile up PHP from source using the <ulink url="&url.openbsd.ports;">ports tree</ulink>. However, this is only recommended for users familiar with OpenBSD. The PHP 4 port is split into two sub-directories: core and extensions. The extensions directory generates sub-packages for all of the supported PHP modules. If you find you do not want to create some of these modules, use the <command>no_*</command> FLAVOR. For example, to skip building the imap module, set the FLAVOR to <command>no_imap</command>. </simpara> </sect2> <sect2 id="install.unix.openbsd.faq"> <title>Common Problems</title> <itemizedlist> <listitem> <simpara>The default install of Apache runs inside a <ulink url="&url.openbsd.chroot;">chroot(2) jail</ulink>, which will restrict PHP scripts to accessing files under <filename>/var/www</filename>. You will therefore need to create a <filename>/var/www/tmp</filename> directory for PHP session files to be stored, or use an alternative session backend. In addition, database sockets need to be placed inside the jail or listen on the <filename>localhost</filename> interface. If you use network functions, some files from <filename>/etc</filename> such as <filename>/etc/resolv.conf</filename> and <filename>/etc/services</filename> will need to be moved into <filename>/var/www/etc</filename>. The OpenBSD PEAR package automatically installs into the correct chroot directories, so no special modification is needed there. More information on the OpenBSD Apache is available in the <ulink url="&url.openbsd.apachefaq;">OpenBSD FAQ</ulink>. </simpara> </listitem> <listitem> <simpara> The OpenBSD 3.4 package for the <ulink url="&url.gd;">gd</ulink> extension requires XFree86 to be installed. If you do not wish to use some of the font features that require X11, install the <filename>php4-gd-4.3.3-no_x11.tgz</filename> package instead. </simpara> </listitem> </itemizedlist> </sect2> <sect2 id="install.unix.openbsd.older"> <title>Older Releases</title> <simpara> Older releases of OpenBSD used the FLAVORS system to compile up a statically linked PHP. Since it is hard to generate binary packages using this method, it is now deprecated. You can still use the old stable ports trees if you wish, but they are unsupported by the OpenBSD team. If you have any comments about this, the current maintainer for the port is Anil Madhavapeddy (avsm at openbsd dot org). </simpara> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/solaris.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/solaris.xml +++ phpdoc/en/install/unix/solaris.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.solaris"> <title>Solaris specific installation tips</title> <para> This section contains notes and hints specific to installing PHP on Solaris systems. </para> <sect2 id="install.unix.solaris.required"> <title>Required software</title> <para> Solaris installs often lack C compilers and their related tools. Read <link linkend="faq.installation.needgnu">this FAQ</link> for information on why using GNU versions for some of these tools is necessary. The required software is as follows: <itemizedlist> <listitem> <simpara> gcc (recommended, other C compilers may work) </simpara> </listitem> <listitem> <simpara> make </simpara> </listitem> <listitem> <simpara> flex </simpara> </listitem> <listitem> <simpara> bison </simpara> </listitem> <listitem> <simpara> m4 </simpara> </listitem> <listitem> <simpara> autoconf </simpara> </listitem> <listitem> <simpara> automake </simpara> </listitem> <listitem> <simpara> perl </simpara> </listitem> <listitem> <simpara> gzip </simpara> </listitem> <listitem> <simpara> tar </simpara> </listitem> <listitem> <simpara> GNU sed </simpara> </listitem> </itemizedlist> In addition, you will need to install (and possibly compile) any additional software specific to your configuration, such as Oracle or MySQL. </para> </sect2> <sect2 id="install.unix.solaris.packages"> <title>Using Packages</title> <simpara> You can simplify the Solaris install process by using pkgadd to install most of your needed components. </simpara> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc/en/install/unix/sun.xml?r=1.1&p=1 Index: phpdoc/en/install/unix/sun.xml +++ phpdoc/en/install/unix/sun.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <sect1 id="install.unix.sun"> <title>Sun, iPlanet and Netscape servers on Sun Solaris</title> <para> This section contains notes and hints specific to Sun Java System Web Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP on Sun Solaris. </para> <para> From PHP 4.3.3 on you can use PHP scripts with the <link linkend="ref.nsapi">NSAPI module</link> to <link linkend="install.unix.sun.specialpages">generate custom directory listings and error pages</link>. Additional functions for Apache compatibility are also available. For support in current webservers read the <link linkend="install.unix.sun.notes">note about subrequests</link>. </para> <para> You can find more information about setting up PHP for the Netscape Enterprise Server (NES) here: <ulink url="&url.netscape.nsapi;">&url.netscape.nsapi;</ulink> </para> <para> To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape webservers, enter the proper install directory for the <link linkend="install.configure.with-nsapi">--with-nsapi=[DIR]</link> option. The default directory is usually <filename class="directory">/opt/netscape/suitespot/</filename>. Please also read <filename>/php-xxx-version/sapi/nsapi/nsapi-readme.txt</filename>. </para> <para> <orderedlist> <listitem> <para> Install the following packages from <ulink url="&url.sun.freeware;"> &url.sun.freeware;</ulink> or another download site: <simplelist> <member><filename>autoconf-2.13</filename></member> <member><filename>automake-1.4</filename></member> <member><filename>bison-1_25-sol26-sparc-local</filename></member> <member><filename>flex-2_5_4a-sol26-sparc-local</filename></member> <member><filename>gcc-2_95_2-sol26-sparc-local</filename></member> <member><filename>gzip-1.2.4-sol26-sparc-local</filename></member> <member><filename>m4-1_4-sol26-sparc-local</filename></member> <member><filename>make-3_76_1-sol26-sparc-local</filename></member> <member> <filename>mysql-3.23.24-beta</filename> (if you want mysql support) </member> <member><filename>perl-5_005_03-sol26-sparc-local</filename></member> <member><filename>tar-1.13</filename> (GNU tar)</member> </simplelist> </para> </listitem> <listitem> <simpara> Make sure your path includes the proper directories <literal>PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin</literal> and make it available to your system <userinput>export PATH</userinput>. </simpara> </listitem> <listitem> <simpara> <userinput>gunzip php-x.x.x.tar.gz</userinput> (if you have a .gz dist, otherwise go to 4). </simpara> </listitem> <listitem> <simpara> <userinput>tar xvf php-x.x.x.tar</userinput> </simpara> </listitem> <listitem> <simpara> Change to your extracted PHP directory: <userinput>cd ../php-x.x.x </userinput> </simpara> </listitem> <listitem> <para> For the following step, make sure <filename class="directory">/opt/netscape/suitespot/</filename> is where your netscape server is installed. Otherwise, change to the correct path and run: <programlisting role="shell"> <![CDATA[ /configure --with-mysql=/usr/local/mysql \ --with-nsapi=/opt/netscape/suitespot/ \ --enable-libgcc ]]> </programlisting> </para> </listitem> <listitem> <simpara> Run <command>make</command> followed by <command>make install</command>. </simpara> </listitem> </orderedlist> </para> <para> After performing the base install and reading the appropriate readme file, you may need to perform some additional configuration steps. </para> <formalpara> <title>Configuration Instructions for Sun/iPlanet/Netscape</title> <para> Firstly you may need to add some paths to the <varname>LD_LIBRARY_PATH</varname> environment for the server to find all the shared libs. This can best done in the start script for your webserver. The start script is often located in: <filename class="directory">/path/to/server/https-servername/start</filename>. You may also need to edit the configuration files that are located in: <filename class="directory">/path/to/server/https-servername/config/</filename>. <orderedlist> <listitem> <para> Add the following line to <filename>mime.types</filename> (you can do that by the administration server): <screen> <![CDATA[ type=magnus-internal/x-httpd-php exts=php ]]> </screen> </para> </listitem> <listitem> <para> Edit <filename>magnus.conf</filename> (for servers >= 6) or <filename>obj.conf</filename> (for servers < 6) and add the following, shlib will vary depending on your system, it will be something like <filename>/opt/netscape/suitespot/bin/libphp4.so</filename>. You should place the following lines after <literal>mime types init</literal>. <programlisting> <![CDATA[ Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="/opt/netscape/suitespot/bin/libphp4.so" Init fn="php4_init" LateInit="yes" errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"] ]]> </programlisting> (PHP >= 4.3.3) The <literal>php_ini</literal> parameter is optional but with it you can place your &php.ini; in your webserver config directory. </para> </listitem> <listitem> <para> Configure the default object in <filename>obj.conf</filename> (for virtual server classes [version 6.0+] in their <filename>vserver.obj.conf</filename>): <programlisting> <![CDATA[ <Object name="default">