cvs: phpdoc-zh /chapters config.xml
| From: | Gregory Song | Date: | Thu, 29 Aug 2002 04:26:27 +0000 |
| Subject: | cvs: phpdoc-zh /chapters config.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-404@lists.php.net to get a copy of this message | ||
gregory Thu Aug 29 00:26:27 2002 EDT
Modified files:
/phpdoc-zh/chapters config.xml
Log:
Recovered to current En Version, to avoid errors on making.
Index: phpdoc-zh/chapters/config.xml diff -u phpdoc-zh/chapters/config.xml:1.3 phpdoc-zh/chapters/config.xml:1.4 --- phpdoc-zh/chapters/config.xml:1.3 Mon Aug 26 00:10:48 2002 +++ phpdoc-zh/chapters/config.xml Thu Aug 29 00:26:26 2002 @@ -1,41 +1,47 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.63 Maintainer: verdana Status: partly --> +<!-- $Revision: 1.4 $ --> +<!-- $Author: gregory $ --> +<!-- EN-Revision: 1.72 Maintainer: verdana Status: recovered --> <chapter id="configuration"> - <title>ÅäÖÃ</title> + <title>Configuration</title> <sect1 id="configuration.file"> - <title>ÅäÖÃÎļþ</title> + <title>The configuration file</title> <simpara> - PHP Æô¶¯Ê±¶ÁÈ¡ÅäÖÃÎļþ £¨PHP 3.0 ÖгÆÎª <filename>php3.ini</filename>£¬¶ø - PHP 4.0 ÖÐÔò¼ò»¯Îª &php.ini;£©¡£¶ÔÓÚ·þÎñÆ÷Ä£¿é°æ±¾µÄ PHP£¬ÕâÒ»¹ý³Ì½öÔÚ·þÎñ - Æ÷Æô¶¯Ê±²Å·¢Éú¡£¶ÔÓÚ <acronym>CGI</acronym> ºÍ <acronym>CLI</acronym> °æ±¾ - £¬Ã¿´Îµ÷ÓýâÎöÆ÷¶¼»á¶ÁÈ¡ÅäÖÃÎļþ¡£ + The configuration file (called <filename>php3.ini</filename> in + PHP 3.0, and simply &php.ini; as of PHP 4.0) + 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> - &php.ini; ÎļþµÄĬÈÏλÖÃÊÇÒ»¸ö±àÒëʱѡÏÇë²ÎÕÕ - <link linkend="faq.installation.phpini">FAQ</link>£©£¬µ«¶ÔÓÚ <acronym>CGI</acronym> - ºÍ <acronym>CLI</acronym> °æ±¾£¬¸ÃλÖÿÉÒÔͨ¹ýʹÓà <literal>-c</literal> ÃüÁîÐпª¹Ø - À´¸Ä±ä£¬²ÎÕÕÓйØÕ½ڣº´Ó <link linkend="features.commandline">ÃüÁîÐÐ</link> ʹÓà - <literal>PHP</literal>¡£ÄãÒ²¿ÉÒÔʹÓû·¾³±äÁ¿ <literal>PHPRC</literal> ×÷Ϊ¸½¼Ó·¾¶ - ÒÔËÑѰ &php.ini;¡£ + 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 + <literal>PHP</literal> from the <link + linkend="features.commandline">command line</link>. You can also use the + environment variable <literal>PHPRC</literal> for an additionaly path to + search for &php.ini;. </para> <para> - ²¢²»ÊÇÿ¸ö PHP Ö¸Áî¶¼±¸ÓÐÎĵµ¡£ÎªµÃµ½ËùÓÐÖ¸ÁîµÄÁÐ±í£¬ÇëÔĶÁÄúÊÖÖеÄ×¢ÊÍºÃµÄ &php.ini; - Îļþ¡£´Ó CVS Äú¿ÉÒԲ鿴µ½×îÐ嵀 <ulink url="&url.php.cvs.phpini;">php.ini</ulink> Îļþ¡£ + Not every PHP directive is documented below. For a list of all directives, + please read your well commented &php.ini; file. You may want to view the + latest <ulink url="&url.php.cvs.phpini;">php.ini here</ulink> from CVS. </para> <note> <para> - PHP Ö¸Áî <link linkend="ini.register-globals">register_globals</link> µÄĬÈÏÖµ£¬ - ÔÚ <ulink url="&url.php.release4.2.0">4.2.0</ulink> °æ±¾ÖУ¬ÓÉ - <emphasis>on</emphasis> ÐÞ¸ÄΪ <emphasis>off</emphasis>¡£ + The default value for the PHP directive + <link linkend="ini.register-globals">register_globals</link> changed from + <emphasis>on</emphasis> to <emphasis>off</emphasis> in PHP + <ulink url="&url.php.release4.2.0;">4.2.0</ulink>. </para> </note> <para> <example> - <title>&php.ini; ʾÀý</title> + <title>&php.ini; example</title> <programlisting role="ini"> <![CDATA[ ; any text on a line after an unquoted semicolon (;) is ignored @@ -58,18 +64,22 @@ </para> <simpara> - µ±ÒÔ Apache Ä£¿é·½Ê½Ê¹Óà PHP ʱ£¬ÄúÒ²¿ÉÒÔʹÓà Apache ÅäÖÃÎļþºÍ - .htaccess Îļþ£¨Äú½«ÐèÒª¡°AllowOverride Options¡±»òÕß¡°AllowOverride All¡± - ȨÏÞ¡££©ÖеÄÖ¸ÁîÀ´¸Ä±ä PHP µÄÅäÖᣠ+ When using PHP as an Apache module, you can also change the + configuration settings using directives in Apache configuration + files and .htaccess files (You will need "AllowOverride + Options" or "AllowOverride All" privileges) </simpara> <simpara> - PHP 3.0 ÖУ¬Apache Ö¸ÁîÏ൱ÓÚ <filename>php3.ini</filename> ÖеÄÖ¸Á - ²»Í¬µÄÊÇ£¬Apache Ö¸Áî´øÓÐǰ׺ ¡°php3_¡±¡£ + With PHP 3.0, 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> <para> - PHP 4.0 ÖУ¬Óм¸¸ö Apache Ö¸ÁîÔÊÐíÄúÔÚÆäÅäÖÃÎļþÖÐÐÞ¸Ä PHP µÄÅäÖᣠ+ With PHP 4.0, there are several Apache directives that allow you + to change the PHP configuration from within the Apache + configuration file itself. <variablelist> <varlistentry> <term> @@ -79,7 +89,7 @@ </term> <listitem> <para> - ÉèÖÃÖ¸¶¨±äÁ¿µÄÖµ¡£</para> + This sets the value of the specified variable.</para> </listitem> </varlistentry> <varlistentry> @@ -90,7 +100,7 @@ </term> <listitem> <para> - ÓÃÓÚÉèÖÃÒ»¸ö Boolean ÅäÖÃÑ¡ÏîµÄÖµ¡£</para> + This is used to set a Boolean configuration option.</para> </listitem> </varlistentry> <varlistentry> @@ -101,8 +111,10 @@ </term> <listitem> <para> - ÉèÖÃÖ¸¶¨±äÁ¿µÄÖµ¡£¡°Admin¡±ÅäÖÃÖ¸ÁîÖ»ÄÜÔÚ Apache Ö÷ÅäÖÃÎļþÖÐʹÓ㬠- ÎÞ·¨ÓÃÓÚ .htaccess Îļþ¡£</para> + This sets the value of the specified variable. "Admin" + configuration settings can only be set from within the + main Apache configuration files, and not from .htaccess + files.</para> </listitem> </varlistentry> <varlistentry> @@ -113,7 +125,7 @@ </term> <listitem> <para> - ÓÃÓÚÉèÖÃÒ»¸ö Boolean ÅäÖÃÑ¡ÏîµÄÖµ¡£</para> + This is used to set a Boolean configuration option.</para> </listitem> </varlistentry> </variablelist> @@ -125,7 +137,7 @@ <![CDATA[ <IfModule mod_php4.c> php_value include_path ".:/usr/local/lib/php" - php_flag safe_mode on + php_admin_flag safe_mode on </IfModule> <IfModule mod_php3.c> php3_include_path ".:/usr/local/lib/php" @@ -134,15 +146,29 @@ ]]> </programlisting> </example> + + <note> + <para> + PHP constants do not exist outside of PHP. For example, in + <filename>httpd.conf</filename> do 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> + </note> </para> <simpara> - Äú¿ÉÒÔͨ¹ý <function>phpinfo</function> º¯ÊýµÄÊä³öÄÚÈݲ鿴ÅäÖÃÎļþÖÐÉèÖÃÑ¡ÏîµÄÖµ¡£ - Ò²¿ÉÒÔʹÓà <function>get_cfg_var</function> º¯Êý»ñÈ¡µ¥¶ÀÉèÖÃÑ¡ÏîµÄÖµ¡£ + You can view the settings of the configuration values in + the output of <function>phpinfo</function>. You can also + access the values of individual configuration settings using + <function>ini_get</function> or <function>get_cfg_var</function>. </simpara> <sect2 id="ini.sect.general"> - <title>Ö÷ÒªÅäÖÃÖ¸Áî</title> + <title>General Configuration Directives</title> <para> <variablelist> <varlistentry id="ini.allow-url-fopen"> @@ -153,23 +179,19 @@ <listitem> <para> This option enables the URL-aware fopen wrappers that enable -accessing URL object - like files. Default wrappers are provided for the access of - <link linkend="features.remote-files">remote files</link> + accessing URL object like files. Default wrappers are provided for + the access of <link linkend="features.remote-files">remote files</link> using the ftp or http protocol, some extensions like zlib may -register additional wrappers. + register additional wrappers. </para> <note> <para> This option was introduced immediately after the release of version -4.0.3. - For versions up to and including 4.0.3 you can only disable this -feature at - compile time by using the configuration switch - <link -linkend="install.configure.disable-url-fopen-wrapper"><parameter>--d -isable-url-fopen-wrapper</parameter></link>. + 4.0.3. For versions up to and including 4.0.3 you can only disable this + feature at compile time by using the configuration switch + <link linkend="install.configure.disable-url-fopen-wrapper"><parameter> + --disable-url-fopen-wrapper</parameter></link>. </para> </note> <warning> @@ -195,11 +217,13 @@ the usual <?php ?> tags. This includes the variable-value printing shorthand of <%= $value %>. For more information, see <link -linkend="language.basic-syntax.phpmode">Escaping from HTML</link>. + linkend="language.basic-syntax.phpmode">Escaping from HTML</link>. </simpara> <note> - <para>Support for ASP-style tags was added in 3.0.4.</para> + <para> + Support for ASP-style tags was added in 3.0.4. + </para> </note> </listitem> @@ -218,12 +242,13 @@ <link linkend="ini.include-path">include_path</link> is used.</para> <para> The special value <systemitem class="constant">none</systemitem> -disables auto-appending. + disables auto-appending. <note> <simpara> If the script is terminated with <function>exit</function>, auto-append will <emphasis>not</emphasis> occur.</simpara> - </note></para> + </note> + </para> </listitem> </varlistentry> @@ -240,7 +265,8 @@ <link linkend="ini.include-path">include_path</link> is used.</para> <para> The special value <systemitem class="constant">none</systemitem> -disables auto-prepending.</para> + disables auto-prepending. + </para> </listitem> </varlistentry> @@ -285,7 +311,7 @@ <para> PHP's "root directory" on the server. Only used if non-empty. If PHP is configured with <link -linkend="ini.safe-mode">safe mode</link>, no files outside + linkend="ini.safe-mode">safe mode</link>, no files outside this directory are served. </para> </listitem> @@ -320,7 +346,8 @@ special value <literal>syslog</literal> is used, the errors are sent to the system logger instead. On UNIX, this means syslog(3) and on Windows NT it means the event log. The - system logger is not supported on Windows 95.</para> + system logger is not supported on Windows 95. + </para> </listitem> </varlistentry> @@ -331,44 +358,38 @@ </term> <listitem> <para> - Set the error reporting level. The parameter is an integer - representing a bit field. Add the values of the error - reporting levels you want. - <table> - <title>Error Reporting Levels</title> - <tgroup cols="2"> - <thead> - <row> - <entry>bit value</entry> - <entry>enabled reporting</entry> - </row> - </thead> - <tbody> - <row> - <entry>1</entry> - <entry>normal errors</entry> - </row> - <row> - <entry>2</entry> - <entry>normal warnings</entry> - </row> - <row> - <entry>4</entry> - <entry>parser errors</entry> - </row> - <row> - <entry>8</entry> - <entry>non-critical style-related warnings</entry> - </row> - </tbody> - </tgroup> - </table> - The default value for this directive is 7 (normal errors, - normal warnings and parser errors are shown). + Set the error reporting level. The parameter is either an integer + representing a bit field, or named constants. The error_reporting + levels and constants are described in the + <link linkend="features.error-handling">Error Handling</link> section + of the manual, and in &php.ini;. To set at runtime, use the + <function>error_reporting</function> function. See also the + <link linkend="ini.display-errors">display_errors</link> directive. + </para> + <para> + The default value does not show <constant>E_NOTICE</constant> level + errors. You may want to show them during development. </para> </listitem> </varlistentry> + <varlistentry id="ini.file-uploads"> + <term> + <parameter>file_uploads</parameter> + <type>boolean</type> + </term> + <listitem> + <para> + Whether or not to allow HTTP + <link linkend="features.file-upload">file uploads</link>. See also + the + <link linkend="ini.upload-max-filesize">upload_max_filesize</link>, + <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link>, and + <link linkend="ini.post-max-size">post_max_size</link> directives. + </para> + </listitem> + </varlistentry> + <varlistentry id="ini.html-errors"> <term> <parameter>html_errors</parameter> @@ -376,11 +397,57 @@ </term> <listitem> <para> - Turn off HTML tags in error messages. + Turn off HTML tags in error messages. The new format for html errors produces + clickable messages that direct the user to a page describing the error or + function in causing the error. These references are affected by + <link linkend="ini.docref-root">docref_root</link> and + <link linkend="ini.docref-ext">docref_ext</link>. </para> </listitem> </varlistentry> + <varlistentry id="ini.docref-root"> + <term> + <parameter>docref_root</parameter> + <type>string</type> + </term> + <listitem> + <para> + The new error format contains a reference to a page describing the error or + function in causing the error. In case of manual pages you can download the + manual in your language and set this ini directive to the url of your local + copy. If your local copy of the manual can be reached by '/manual/' you can + simply use <userinput>docref_root=/manual/</userinput>. Additional you have + to set docref_ext to match the fileextensions of your copy + <userinput>docref_ext=.html</userinput>. It is possible to use external + references. For example you can use + <userinput>docref_root=http://manual/en/</userinput>. + </para> + <note> + <para> + The value of docref_root must end with a slash '/'. + </para> + </note> + </listitem> + </varlistentry> + + <varlistentry id="ini.docref-ext"> + <term> + <parameter>docref_ext</parameter> + <type>string</type> + </term> + <listitem> + <para> + See <link linkend="ini.docref-root">docref_root</link>. + </para> + <note> + <para> + The value of docref_ext must begin with a dot '.'. + </para> + </note> + </listitem> + </varlistentry> + <varlistentry id="ini.open-basedir"> <term> <parameter>open_basedir</parameter> @@ -418,7 +485,9 @@ "open_basedir = /dir/incl/" </para> <note> - <para>Support for multiple directories was added in 3.0.7.</para> + <para> + Support for multiple directories was added in 3.0.7. + </para> </note> <para> The default is to allow all files to be opened. @@ -743,7 +812,7 @@ Tells whether the short form (<userinput><? ?></userinput>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to - use (<userinput><?xml ?></userinput> inline. Otherwise, you + use <userinput><?xml ?></userinput> inline. Otherwise, you can print it with PHP, for example: <userinput><?php echo '<?xml version="1.0"'; ?></userinput>. Also if disabled, you must use the long form of the PHP open tag (<userinput><?php ?></userinput>). @@ -840,7 +909,8 @@ <para> The base name of the directory used on a user's home directory for PHP files, for example - <literal>public_html</literal>.</para> + <literal>public_html</literal>. + </para> </listitem> </varlistentry> @@ -855,7 +925,8 @@ plus (<literal>+</literal>) operator is used on strings. This is to make it easier to find scripts that need to be rewritten to using the string concatenator instead - (<literal>.</literal>).</para> + (<literal>.</literal>). + </para> </listitem> </varlistentry> @@ -877,7 +948,8 @@ Whether to enable PHP's safe mode. Read the <link linkend="security">Security</link> and <link linkend="features.safe-mode">Safe Mode</link> chapters for - more information.</para> + more information. + </para> </listitem> </varlistentry> @@ -905,7 +977,8 @@ <para> If PHP is used in safe mode, <function>system</function> and the other functions executing system programs refuse to start - programs that are not in this directory.</para> + programs that are not in this directory. + </para> </listitem> </varlistentry> @@ -921,6 +994,11 @@ must also be in <link linkend="ini.include-path">include_path</link> or full path must including). </para> + <simpara> + As of PHP 4.2.0, this directive can take on a semi-colon separated + path in a similar fashion to the include_path directive, rather than + just a single directory. + </simpara> </listitem> </varlistentry> @@ -938,7 +1016,8 @@ </term> <listitem> <para> - DNS name or IP address of host used by the debugger.</para> + DNS name or IP address of host used by the debugger. + </para> </listitem> </varlistentry> @@ -949,7 +1028,8 @@ </term> <listitem> <para> - Port number used by the debugger.</para> + Port number used by the debugger. + </para> </listitem> </varlistentry> @@ -960,7 +1040,8 @@ </term> <listitem> <para> - Whether the debugger is enabled.</para> + Whether the debugger is enabled. + </para> </listitem> </varlistentry> @@ -1004,7 +1085,8 @@ <listitem> <para> In what directory PHP should look for dynamically loadable - extensions.</para> + extensions. + </para> </listitem> </varlistentry> @@ -1016,7 +1098,8 @@ <listitem> <para> Which dynamically loadable extensions to load when PHP starts - up.</para> + up. + </para> </listitem> </varlistentry>
Index: phpdoc-zh/chapters/config.xml diff -u phpdoc-zh/chapters/config.xml:1.3 phpdoc-zh/chapters/config.xml:1.4 --- phpdoc-zh/chapters/config.xml:1.3 Mon Aug 26 00:10:48 2002 +++ phpdoc-zh/chapters/config.xml Thu Aug 29 00:26:26 2002 @@ -1,41 +1,47 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.63 Maintainer: verdana Status: partly --> +<!-- $Revision: 1.4 $ --> +<!-- $Author: gregory $ --> +<!-- EN-Revision: 1.72 Maintainer: verdana Status: recovered --> <chapter id="configuration"> - <title>ÅäÖÃ</title> + <title>Configuration</title> <sect1 id="configuration.file"> - <title>ÅäÖÃÎļþ</title> + <title>The configuration file</title> <simpara> - PHP Æô¶¯Ê±¶ÁÈ¡ÅäÖÃÎļþ £¨PHP 3.0 ÖгÆÎª <filename>php3.ini</filename>£¬¶ø - PHP 4.0 ÖÐÔò¼ò»¯Îª &php.ini;£©¡£¶ÔÓÚ·þÎñÆ÷Ä£¿é°æ±¾µÄ PHP£¬ÕâÒ»¹ý³Ì½öÔÚ·þÎñ - Æ÷Æô¶¯Ê±²Å·¢Éú¡£¶ÔÓÚ <acronym>CGI</acronym> ºÍ <acronym>CLI</acronym> °æ±¾ - £¬Ã¿´Îµ÷ÓýâÎöÆ÷¶¼»á¶ÁÈ¡ÅäÖÃÎļþ¡£ + The configuration file (called <filename>php3.ini</filename> in + PHP 3.0, and simply &php.ini; as of PHP 4.0) + 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> - &php.ini; ÎļþµÄĬÈÏλÖÃÊÇÒ»¸ö±àÒëʱѡÏÇë²ÎÕÕ - <link linkend="faq.installation.phpini">FAQ</link>£©£¬µ«¶ÔÓÚ <acronym>CGI</acronym> - ºÍ <acronym>CLI</acronym> °æ±¾£¬¸ÃλÖÿÉÒÔͨ¹ýʹÓà <literal>-c</literal> ÃüÁîÐпª¹Ø - À´¸Ä±ä£¬²ÎÕÕÓйØÕ½ڣº´Ó <link linkend="features.commandline">ÃüÁîÐÐ</link> ʹÓà - <literal>PHP</literal>¡£ÄãÒ²¿ÉÒÔʹÓû·¾³±äÁ¿ <literal>PHPRC</literal> ×÷Ϊ¸½¼Ó·¾¶ - ÒÔËÑѰ &php.ini;¡£ + 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 + <literal>PHP</literal> from the <link + linkend="features.commandline">command line</link>. You can also use the + environment variable <literal>PHPRC</literal> for an additionaly path to + search for &php.ini;. </para> <para> - ²¢²»ÊÇÿ¸ö PHP Ö¸Áî¶¼±¸ÓÐÎĵµ¡£ÎªµÃµ½ËùÓÐÖ¸ÁîµÄÁÐ±í£¬ÇëÔĶÁÄúÊÖÖеÄ×¢ÊÍºÃµÄ &php.ini; - Îļþ¡£´Ó CVS Äú¿ÉÒԲ鿴µ½×îÐ嵀 <ulink url="&url.php.cvs.phpini;">php.ini</ulink> Îļþ¡£ + Not every PHP directive is documented below. For a list of all directives, + please read your well commented &php.ini; file. You may want to view the + latest <ulink url="&url.php.cvs.phpini;">php.ini here</ulink> from CVS. </para> <note> <para> - PHP Ö¸Áî <link linkend="ini.register-globals">register_globals</link> µÄĬÈÏÖµ£¬ - ÔÚ <ulink url="&url.php.release4.2.0">4.2.0</ulink> °æ±¾ÖУ¬ÓÉ - <emphasis>on</emphasis> ÐÞ¸ÄΪ <emphasis>off</emphasis>¡£ + The default value for the PHP directive + <link linkend="ini.register-globals">register_globals</link> changed from + <emphasis>on</emphasis> to <emphasis>off</emphasis> in PHP + <ulink url="&url.php.release4.2.0;">4.2.0</ulink>. </para> </note> <para> <example> - <title>&php.ini; ʾÀý</title> + <title>&php.ini; example</title> <programlisting role="ini"> <![CDATA[ ; any text on a line after an unquoted semicolon (;) is ignored @@ -58,18 +64,22 @@ </para> <simpara> - µ±ÒÔ Apache Ä£¿é·½Ê½Ê¹Óà PHP ʱ£¬ÄúÒ²¿ÉÒÔʹÓà Apache ÅäÖÃÎļþºÍ - .htaccess Îļþ£¨Äú½«ÐèÒª¡°AllowOverride Options¡±»òÕß¡°AllowOverride All¡± - ȨÏÞ¡££©ÖеÄÖ¸ÁîÀ´¸Ä±ä PHP µÄÅäÖᣠ+ When using PHP as an Apache module, you can also change the + configuration settings using directives in Apache configuration + files and .htaccess files (You will need "AllowOverride + Options" or "AllowOverride All" privileges) </simpara> <simpara> - PHP 3.0 ÖУ¬Apache Ö¸ÁîÏ൱ÓÚ <filename>php3.ini</filename> ÖеÄÖ¸Á - ²»Í¬µÄÊÇ£¬Apache Ö¸Áî´øÓÐǰ׺ ¡°php3_¡±¡£ + With PHP 3.0, 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> <para> - PHP 4.0 ÖУ¬Óм¸¸ö Apache Ö¸ÁîÔÊÐíÄúÔÚÆäÅäÖÃÎļþÖÐÐÞ¸Ä PHP µÄÅäÖᣠ+ With PHP 4.0, there are several Apache directives that allow you + to change the PHP configuration from within the Apache + configuration file itself. <variablelist> <varlistentry> <term> @@ -79,7 +89,7 @@ </term> <listitem> <para> - ÉèÖÃÖ¸¶¨±äÁ¿µÄÖµ¡£</para> + This sets the value of the specified variable.</para> </listitem> </varlistentry> <varlistentry> @@ -90,7 +100,7 @@ </term> <listitem> <para> - ÓÃÓÚÉèÖÃÒ»¸ö Boolean ÅäÖÃÑ¡ÏîµÄÖµ¡£</para> + This is used to set a Boolean configuration option.</para> </listitem> </varlistentry> <varlistentry> @@ -101,8 +111,10 @@ </term> <listitem> <para> - ÉèÖÃÖ¸¶¨±äÁ¿µÄÖµ¡£¡°Admin¡±ÅäÖÃÖ¸ÁîÖ»ÄÜÔÚ Apache Ö÷ÅäÖÃÎļþÖÐʹÓ㬠- ÎÞ·¨ÓÃÓÚ .htaccess Îļþ¡£</para> + This sets the value of the specified variable. "Admin" + configuration settings can only be set from within the + main Apache configuration files, and not from .htaccess + files.</para> </listitem> </varlistentry> <varlistentry> @@ -113,7 +125,7 @@ </term> <listitem> <para> - ÓÃÓÚÉèÖÃÒ»¸ö Boolean ÅäÖÃÑ¡ÏîµÄÖµ¡£</para> + This is used to set a Boolean configuration option.</para> </listitem> </varlistentry> </variablelist> @@ -125,7 +137,7 @@ <![CDATA[ <IfModule mod_php4.c> php_value include_path ".:/usr/local/lib/php" - php_flag safe_mode on + php_admin_flag safe_mode on </IfModule> <IfModule mod_php3.c> php3_include_path ".:/usr/local/lib/php" @@ -134,15 +146,29 @@ ]]> </programlisting> </example> + + <note> + <para> + PHP constants do not exist outside of PHP. For example, in + <filename>httpd.conf</filename> do 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> + </note> </para> <simpara> - Äú¿ÉÒÔͨ¹ý <function>phpinfo</function> º¯ÊýµÄÊä³öÄÚÈݲ鿴ÅäÖÃÎļþÖÐÉèÖÃÑ¡ÏîµÄÖµ¡£ - Ò²¿ÉÒÔʹÓà <function>get_cfg_var</function> º¯Êý»ñÈ¡µ¥¶ÀÉèÖÃÑ¡ÏîµÄÖµ¡£ + You can view the settings of the configuration values in + the output of <function>phpinfo</function>. You can also + access the values of individual configuration settings using + <function>ini_get</function> or <function>get_cfg_var</function>. </simpara> <sect2 id="ini.sect.general"> - <title>Ö÷ÒªÅäÖÃÖ¸Áî</title> + <title>General Configuration Directives</title> <para> <variablelist> <varlistentry id="ini.allow-url-fopen"> @@ -153,23 +179,19 @@ <listitem> <para> This option enables the URL-aware fopen wrappers that enable -accessing URL object - like files. Default wrappers are provided for the access of - <link linkend="features.remote-files">remote files</link> + accessing URL object like files. Default wrappers are provided for + the access of <link linkend="features.remote-files">remote files</link> using the ftp or http protocol, some extensions like zlib may -register additional wrappers. + register additional wrappers. </para> <note> <para> This option was introduced immediately after the release of version -4.0.3. - For versions up to and including 4.0.3 you can only disable this -feature at - compile time by using the configuration switch - <link -linkend="install.configure.disable-url-fopen-wrapper"><parameter>--d -isable-url-fopen-wrapper</parameter></link>. + 4.0.3. For versions up to and including 4.0.3 you can only disable this + feature at compile time by using the configuration switch + <link linkend="install.configure.disable-url-fopen-wrapper"><parameter> + --disable-url-fopen-wrapper</parameter></link>. </para> </note> <warning> @@ -195,11 +217,13 @@ the usual <?php ?> tags. This includes the variable-value printing shorthand of <%= $value %>. For more information, see <link -linkend="language.basic-syntax.phpmode">Escaping from HTML</link>. + linkend="language.basic-syntax.phpmode">Escaping from HTML</link>. </simpara> <note> - <para>Support for ASP-style tags was added in 3.0.4.</para> + <para> + Support for ASP-style tags was added in 3.0.4. + </para> </note> </listitem> @@ -218,12 +242,13 @@ <link linkend="ini.include-path">include_path</link> is used.</para> <para> The special value <systemitem class="constant">none</systemitem> -disables auto-appending. + disables auto-appending. <note> <simpara> If the script is terminated with <function>exit</function>, auto-append will <emphasis>not</emphasis> occur.</simpara> - </note></para> + </note> + </para> </listitem> </varlistentry> @@ -240,7 +265,8 @@ <link linkend="ini.include-path">include_path</link> is used.</para> <para> The special value <systemitem class="constant">none</systemitem> -disables auto-prepending.</para> + disables auto-prepending. + </para> </listitem> </varlistentry> @@ -285,7 +311,7 @@ <para> PHP's "root directory" on the server. Only used if non-empty. If PHP is configured with <link -linkend="ini.safe-mode">safe mode</link>, no files outside + linkend="ini.safe-mode">safe mode</link>, no files outside this directory are served. </para> </listitem> @@ -320,7 +346,8 @@ special value <literal>syslog</literal> is used, the errors are sent to the system logger instead. On UNIX, this means syslog(3) and on Windows NT it means the event log. The - system logger is not supported on Windows 95.</para> + system logger is not supported on Windows 95. + </para> </listitem> </varlistentry> @@ -331,44 +358,38 @@ </term> <listitem> <para> - Set the error reporting level. The parameter is an integer - representing a bit field. Add the values of the error - reporting levels you want. - <table> - <title>Error Reporting Levels</title> - <tgroup cols="2"> - <thead> - <row> - <entry>bit value</entry> - <entry>enabled reporting</entry> - </row> - </thead> - <tbody> - <row> - <entry>1</entry> - <entry>normal errors</entry> - </row> - <row> - <entry>2</entry> - <entry>normal warnings</entry> - </row> - <row> - <entry>4</entry> - <entry>parser errors</entry> - </row> - <row> - <entry>8</entry> - <entry>non-critical style-related warnings</entry> - </row> - </tbody> - </tgroup> - </table> - The default value for this directive is 7 (normal errors, - normal warnings and parser errors are shown). + Set the error reporting level. The parameter is either an integer + representing a bit field, or named constants. The error_reporting + levels and constants are described in the + <link linkend="features.error-handling">Error Handling</link> section + of the manual, and in &php.ini;. To set at runtime, use the + <function>error_reporting</function> function. See also the + <link linkend="ini.display-errors">display_errors</link> directive. + </para> + <para> + The default value does not show <constant>E_NOTICE</constant> level + errors. You may want to show them during development. </para> </listitem> </varlistentry> + <varlistentry id="ini.file-uploads"> + <term> + <parameter>file_uploads</parameter> + <type>boolean</type> + </term> + <listitem> + <para> + Whether or not to allow HTTP + <link linkend="features.file-upload">file uploads</link>. See also + the + <link linkend="ini.upload-max-filesize">upload_max_filesize</link>, + <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link>, and + <link linkend="ini.post-max-size">post_max_size</link> directives. + </para> + </listitem> + </varlistentry> + <varlistentry id="ini.html-errors"> <term> <parameter>html_errors</parameter> @@ -376,11 +397,57 @@ </term> <listitem> <para> - Turn off HTML tags in error messages. + Turn off HTML tags in error messages. The new format for html errors produces + clickable messages that direct the user to a page describing the error or + function in causing the error. These references are affected by + <link linkend="ini.docref-root">docref_root</link> and + <link linkend="ini.docref-ext">docref_ext</link>. </para> </listitem> </varlistentry> + <varlistentry id="ini.docref-root"> + <term> + <parameter>docref_root</parameter> + <type>string</type> + </term> + <listitem> + <para> + The new error format contains a reference to a page describing the error or + function in causing the error. In case of manual pages you can download the + manual in your language and set this ini directive to the url of your local + copy. If your local copy of the manual can be reached by '/manual/' you can + simply use <userinput>docref_root=/manual/</userinput>. Additional you have + to set docref_ext to match the fileextensions of your copy + <userinput>docref_ext=.html</userinput>. It is possible to use external + references. For example you can use + <userinput>docref_root=http://manual/en/</userinput>. + </para> + <note> + <para> + The value of docref_root must end with a slash '/'. + </para> + </note> + </listitem> + </varlistentry> + + <varlistentry id="ini.docref-ext"> + <term> + <parameter>docref_ext</parameter> + <type>string</type> + </term> + <listitem> + <para> + See <link linkend="ini.docref-root">docref_root</link>. + </para> + <note> + <para> + The value of docref_ext must begin with a dot '.'. + </para> + </note> + </listitem> + </varlistentry> + <varlistentry id="ini.open-basedir"> <term> <parameter>open_basedir</parameter> @@ -418,7 +485,9 @@ "open_basedir = /dir/incl/" </para> <note> - <para>Support for multiple directories was added in 3.0.7.</para> + <para> + Support for multiple directories was added in 3.0.7. + </para> </note> <para> The default is to allow all files to be opened. @@ -743,7 +812,7 @@ Tells whether the short form (<userinput><? ?></userinput>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to - use (<userinput><?xml ?></userinput> inline. Otherwise, you + use <userinput><?xml ?></userinput> inline. Otherwise, you can print it with PHP, for example: <userinput><?php echo '<?xml version="1.0"'; ?></userinput>. Also if disabled, you must use the long form of the PHP open tag (<userinput><?php ?></userinput>). @@ -840,7 +909,8 @@ <para> The base name of the directory used on a user's home directory for PHP files, for example - <literal>public_html</literal>.</para> + <literal>public_html</literal>. + </para> </listitem> </varlistentry> @@ -855,7 +925,8 @@ plus (<literal>+</literal>) operator is used on strings. This is to make it easier to find scripts that need to be rewritten to using the string concatenator instead - (<literal>.</literal>).</para> + (<literal>.</literal>). + </para> </listitem> </varlistentry> @@ -877,7 +948,8 @@ Whether to enable PHP's safe mode. Read the <link linkend="security">Security</link> and <link linkend="features.safe-mode">Safe Mode</link> chapters for - more information.</para> + more information. + </para> </listitem> </varlistentry> @@ -905,7 +977,8 @@ <para> If PHP is used in safe mode, <function>system</function> and the other functions executing system programs refuse to start - programs that are not in this directory.</para> + programs that are not in this directory. + </para> </listitem> </varlistentry> @@ -921,6 +994,11 @@ must also be in <link linkend="ini.include-path">include_path</link> or full path must including). </para> + <simpara> + As of PHP 4.2.0, this directive can take on a semi-colon separated + path in a similar fashion to the include_path directive, rather than + just a single directory. + </simpara> </listitem> </varlistentry> @@ -938,7 +1016,8 @@ </term> <listitem> <para> - DNS name or IP address of host used by the debugger.</para> + DNS name or IP address of host used by the debugger. + </para> </listitem> </varlistentry> @@ -949,7 +1028,8 @@ </term> <listitem> <para> - Port number used by the debugger.</para> + Port number used by the debugger. + </para> </listitem> </varlistentry> @@ -960,7 +1040,8 @@ </term> <listitem> <para> - Whether the debugger is enabled.</para> + Whether the debugger is enabled. + </para> </listitem> </varlistentry> @@ -1004,7 +1085,8 @@ <listitem> <para> In what directory PHP should look for dynamically loadable - extensions.</para> + extensions. + </para> </listitem> </varlistentry> @@ -1016,7 +1098,8 @@ <listitem> <para> Which dynamically loadable extensions to load when PHP starts - up.</para> + up. + </para> </listitem> </varlistentry>