mirror of
https://github.com/php/doc-zh.git
synced 2026-03-23 22:52:08 +01:00
Fix manual
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- EN-Revision: 027f187b3ed8cdec60db6f83baf8f62b536d1101 Maintainer: Avenger Status: partial -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: Avenger Status: partial -->
|
||||
<section xml:id="ini.core" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>&php.ini; 核心配置选项说明</title>
|
||||
<para>
|
||||
@@ -36,12 +36,6 @@
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.asp-tags">asp_tags</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>PHP 7.0.0. 中移除。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.precision">precision</link></entry>
|
||||
<entry>"14"</entry>
|
||||
@@ -54,22 +48,9 @@
|
||||
<entry>"-1"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>
|
||||
在 PHP 5.3.6 以前,默认值为 100。
|
||||
在 PHP 7.1.0 以前,默认值为 17。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.y2k-compliance">y2k_compliance</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>在 PHP 5.4.0 中移除该选项。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.allow-call-time-pass-reference">allow_call_time_pass_reference</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>在 PHP 5.4.0 中移除该选项。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.disable-functions">disable_functions</link></entry>
|
||||
<entry>""</entry>
|
||||
@@ -86,7 +67,7 @@
|
||||
<entry><link linkend="ini.exit-on-timeout">exit_on_timeout</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>从 PHP 5.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.expose-php">expose_php</link></entry>
|
||||
@@ -110,13 +91,13 @@
|
||||
<entry><link linkend="ini.zend.multibyte">zend.multibyte</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>从 PHP 5.4.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.zend.script-encoding">zend.script_encoding</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>从 PHP 5.4.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.zend.detect-unicode">zend.detect-unicode</link></entry>
|
||||
@@ -128,19 +109,13 @@
|
||||
<entry><link linkend="ini.zend.signal-check">zend.signal_check</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>从 PHP 5.4.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.zend.assertions">zend.assertions</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>从 PHP 7.0.0 起可用</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>detect_unicode</entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>从 PHP 5.1.0起可用。 PHP 5.4.0 起重命名为 <link linkend="ini.zend.detect-unicode">zend.detect-unicode</link>。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -169,55 +144,13 @@
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
本指令也会影响到缩写形式
|
||||
<userinput><?=</userinput>,它和
|
||||
<userinput><? echo</userinput> 等价。使用此缩写需要
|
||||
<systemitem role="directive">short_open_tag</systemitem>
|
||||
的值为 On。
|
||||
从 PHP 5.4.0 起, <userinput><?=</userinput> 总是可用的。
|
||||
本指令不会影响到缩写形式
|
||||
<userinput><?=</userinput>,因为它总是可用的。
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.asp-tags">
|
||||
<term>
|
||||
<parameter>asp_tags</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
除了通常的
|
||||
<?php ?>
|
||||
标志之外还允许使用
|
||||
ASP 风格的标志 <% %>。这也包括了输出变量值的缩写
|
||||
<%= $value %>。更多信息见<link
|
||||
linkend="language.basic-syntax.phpmode">从 HTML 中分离</link>一节。
|
||||
</simpara>
|
||||
<para>
|
||||
<table>
|
||||
<title><literal>asp_tags</literal> 变更历史</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>7.0.0</entry>
|
||||
<entry>
|
||||
从 PHP 中移除。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.precision">
|
||||
<term>
|
||||
<parameter>precision</parameter>
|
||||
@@ -245,71 +178,6 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.y2k-compliance">
|
||||
<term>
|
||||
<parameter>y2k_compliance</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
强制 2000 年兼容(在不兼容的浏览器中会出问题)。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry xml:id="ini.allow-call-time-pass-reference">
|
||||
<term>
|
||||
<parameter>allow_call_time_pass_reference</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
在函数调用时参数被按照引用传递时是否发出警告。此方法已不被赞成并在
|
||||
PHP/Zend 未来的版本中很可能不再支持。鼓励使用的方法是在函数定义中指定哪些参数应该用引用传递。鼓励大家尝试关闭此选项并确保脚本能够正常运行,以确保该脚本也能在未来的版本中运行(每次使用此特性都会收到一条警告)。
|
||||
</para>
|
||||
<para>
|
||||
在函数调用时通过引用传递参数是不推荐的,因为它影响到了代码的整洁。如果函数的参数没有声明作为引用传递,函数可以通过未写入文档的方法修改其参数。要避免其副作用,最好仅在函数声明时指定那个参数需要通过引用传递。
|
||||
</para>
|
||||
<para>
|
||||
参见<link linkend="language.references">引用的解释</link>。
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title><literal>allow_call_time_pass_reference</literal> 变更历史</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.4.0</entry>
|
||||
<entry>
|
||||
从 PHP 中移除。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.3.0</entry>
|
||||
<entry>
|
||||
Emits an <constant>E_DEPRECATED</constant> level error.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.0.0</entry>
|
||||
<entry>
|
||||
Deprecated, and generates an <constant>E_COMPILE_WARNING</constant> level error.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.expose-php">
|
||||
<term>
|
||||
<parameter>expose_php</parameter>
|
||||
@@ -319,21 +187,6 @@
|
||||
<para>
|
||||
决定是否暴露 PHP 被安装在服务器上(例如在 Web
|
||||
服务器的信息头中加上其签名:X-Powered-By: PHP/5.3.7)。
|
||||
在 PHP 5.5.0 之前,PHP 徽标指南也是公开的,因此将它们追加到 PHP 脚本的 URL 中就会显示相应的徽标(例如,
|
||||
<link xlink:href="&url.php;?=PHPE9568F34-D428-11d2-A769-00AA001ACF42">&url.php;?=PHPE9568F34-D428-11d2-A769-00AA001ACF42</link>)。这也影响了
|
||||
<function>phpinfo</function> 的输出,因为当禁用时,PHP 的标志和信用信息将无法显示。
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
从 PHP 5.5.0 开始,这些 guid 和 <function>php_logo_guid</function>
|
||||
函数已从 PHP 中删除,guid 被替换为数据 URI。
|
||||
因此,通过在 URL 中添加 guid 来访问 PHP 徽标不再有效。
|
||||
同样,关闭 <parameter>expose_php</parameter> 参数不会影响到在
|
||||
<function>phpinfo</function> 中看到 PHP 标志。
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <function>php_logo_guid</function> and <function>phpcredits</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -537,7 +390,7 @@
|
||||
<entry><link linkend="ini.memory-limit">memory_limit</link></entry>
|
||||
<entry>"128M"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>PHP 5.2.0 之前默认为 "8M",之后默认为 "16M"</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -558,13 +411,6 @@
|
||||
设置了一个脚本允许分配的最大内存量,以字节(bytes)为单位。这有助于防止写得不好的脚本吃掉服务器上所有可用的内存。请注意,如果不需要内存限制,请将此指令设置为
|
||||
<literal>-1</literal>。
|
||||
</para>
|
||||
<para>
|
||||
在 PHP 5.2.1 之前的版本,如果要使用这个指令,必须在编译时使用
|
||||
<option role="configure">--enable-memory-limit</option> 参数。在
|
||||
PHP 5.2.1 之前,如果想要使用函数
|
||||
<function>memory_get_usage</function> 和
|
||||
<function>memory_get_peak_usage</function>,也会需要这个编译参数。
|
||||
</para>
|
||||
|
||||
&ini.shorthandbytes;
|
||||
|
||||
@@ -600,13 +446,13 @@
|
||||
<entry><link linkend="ini.realpath-cache-size">realpath_cache_size</link></entry>
|
||||
<entry>"4M"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>PHP 5.1.0 起加入,PHP 7.0.16 和 7.1.2 之前,默认值为 <literal>"16K"</literal></entry>
|
||||
<entry>PPHP 7.0.16 和 7.1.2 之前,默认值为 <literal>"16K"</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.realpath-cache-ttl">realpath_cache_ttl</link></entry>
|
||||
<entry>"120"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>从 PHP 5.1.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -692,25 +538,19 @@
|
||||
<entry><link linkend="ini.variables-order">variables_order</link></entry>
|
||||
<entry>"EGPCS"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>PHP <= 5.0.5 可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.request-order">request_order</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>从 PHP 5.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.auto-globals-jit">auto_globals_jit</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>从 PHP 5.0.0 起可用。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.register-globals">register_globals</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>PHP 5.4.0 版本被移除。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.register-argc-argv">register_argc_argv</link></entry>
|
||||
@@ -718,12 +558,6 @@
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.register-long-arrays">register_long_arrays</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>PHP 5.3.0 中被废弃,PHP 5.4.0 中被移除。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.enable-post-data-reading">enable_post_data_reading</link></entry>
|
||||
<entry>"1"</entry>
|
||||
@@ -758,13 +592,25 @@
|
||||
<entry><link linkend="ini.default-charset">default_charset</link></entry>
|
||||
<entry>"UTF-8"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>PHP >= 5.6.0 开始默认为 "UTF-8";PHP < 5.6.0 为空。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.always-populate-raw-post-data">always_populate_raw_post_data</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>PHP 7.0.0 中被移除。</entry>
|
||||
<entry><link linkend="ini.input-encoding">input_encoding</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.output-encoding">output_encoding</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.internal-encoding">internal_encoding</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -822,21 +668,6 @@
|
||||
<varname>$_COOKIE</varname>. Setting to "" means no
|
||||
&link.superglobals; will be set.
|
||||
</para>
|
||||
<para>
|
||||
If the deprecated
|
||||
<link linkend="ini.register-globals">register_globals</link>
|
||||
directive is on, then variables_order also
|
||||
configures the order the <literal>ENV</literal>,
|
||||
<literal>GET</literal>, <literal>POST</literal>,
|
||||
<literal>COOKIE</literal> and <literal>SERVER</literal> variables
|
||||
are populated in global scope. So for example if variables_order
|
||||
is set to <literal>"EGPCS"</literal>, register_globals is enabled,
|
||||
and both <varname>$_GET['action']</varname> and
|
||||
<varname>$_POST['action']</varname> are set, then
|
||||
<varname>$action</varname> will contain the value of
|
||||
<varname>$_POST['action']</varname> as <literal>P</literal> comes
|
||||
after <literal>G</literal> in our example directive value.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
In both the CGI and FastCGI SAPIs,
|
||||
@@ -891,15 +722,6 @@
|
||||
variables are not used within a script, having this directive on will
|
||||
result in a performance gain.
|
||||
</para>
|
||||
<para>
|
||||
The PHP directives
|
||||
<link linkend="ini.register-globals">register_globals</link>,
|
||||
<link linkend="ini.register-long-arrays">register_long_arrays</link>,
|
||||
and <link linkend="ini.register-argc-argv">register_argc_argv</link>
|
||||
must be disabled for this directive to have any affect. Since PHP
|
||||
5.1.3 it is not necessary to have <link
|
||||
linkend="ini.register-argc-argv">register_argc_argv</link> disabled.
|
||||
</para>
|
||||
<warning>
|
||||
<para>
|
||||
Usage of SERVER, REQUEST, and ENV variables is checked during the compile time
|
||||
@@ -910,43 +732,7 @@
|
||||
</warning>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.register-globals">
|
||||
<term>
|
||||
<parameter>register_globals</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Whether or not to register the EGPCS (Environment, GET,
|
||||
POST, Cookie, Server) variables as global variables.
|
||||
</para>
|
||||
<para>
|
||||
As of <link xlink:href="&url.php.release4.2.0;">PHP 4.2.0</link>,
|
||||
this directive defaults to <emphasis>off</emphasis>.
|
||||
</para>
|
||||
<para>
|
||||
Please read the security chapter on
|
||||
<link linkend="security.globals">Using register_globals</link>
|
||||
for related information.
|
||||
</para>
|
||||
<para>
|
||||
Please note that <systemitem role="directive">register_globals</systemitem>
|
||||
cannot be set at runtime (<function>ini_set</function>). Although, you can
|
||||
use &htaccess; if your host allows it as described
|
||||
above. An example &htaccess; entry:
|
||||
<userinput>php_flag register_globals off</userinput>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
<systemitem role="directive">register_globals</systemitem> is affected
|
||||
by the <link linkend="ini.variables-order">variables_order</link>
|
||||
directive.
|
||||
</para>
|
||||
</note>
|
||||
&warn.deprecated.feature-5-3-0.removed-5-4-0;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry xml:id="ini.register-argc-argv">
|
||||
<term>
|
||||
@@ -964,29 +750,6 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.register-long-arrays">
|
||||
<term>
|
||||
<parameter>register_long_arrays</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Tells PHP whether or not to register the deprecated long
|
||||
<varname>$HTTP_*_VARS</varname> type
|
||||
<link linkend="language.variables.predefined">predefined
|
||||
variables</link>. When On (default), long predefined PHP
|
||||
variables like <varname>$HTTP_GET_VARS</varname> will be defined.
|
||||
If you're not using them, it's recommended to turn them off,
|
||||
for performance reasons. Instead, use the superglobal arrays,
|
||||
like <varname>$_GET</varname>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
This directive became available in PHP 5.0.0.
|
||||
</simpara>
|
||||
&warn.deprecated.feature-5-3-0.removed-5-4-0;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.enable-post-data-reading">
|
||||
<term>
|
||||
<parameter>enable_post_data_reading</parameter>
|
||||
@@ -1138,7 +901,7 @@
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
In PHP 5.6 onwards, "UTF-8" is the default value and its value is used
|
||||
"UTF-8" is the default value and its value is used
|
||||
as the default character encoding for
|
||||
<function>htmlentities</function>,
|
||||
<function>html_entity_decode</function> and
|
||||
@@ -1176,7 +939,7 @@
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Available from PHP 5.6.0. This setting is used for multibyte modules
|
||||
This setting is used for multibyte modules
|
||||
such as mbstring and iconv. Default is empty.
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -1189,7 +952,7 @@
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Available from PHP 5.6.0. This setting is used for multibyte modules
|
||||
This setting is used for multibyte modules
|
||||
such as mbstring and iconv. Default is empty.
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -1202,41 +965,13 @@
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Available from PHP 5.6.0. This setting is used for multibyte modules
|
||||
This setting is used for multibyte modules
|
||||
such as mbstring and iconv. Default is empty. If empty,
|
||||
<link linkend="ini.default-charset">default_charset</link> is used.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.always-populate-raw-post-data">
|
||||
<term>
|
||||
<parameter>always_populate_raw_post_data</parameter>
|
||||
<type>mixed</type>
|
||||
</term>
|
||||
<listitem>
|
||||
&warn.deprecated.feature-5-6-0.removed-7-0-0;
|
||||
<para>
|
||||
If set to &true;, PHP will always populate the
|
||||
<varname>$HTTP_RAW_POST_DATA</varname> containing the raw POST data.
|
||||
Otherwise, the variable is populated only when the MIME type of the
|
||||
data is unrecognised.
|
||||
</para>
|
||||
<para>
|
||||
The preferred method for accessing raw POST data is
|
||||
<link linkend="wrappers.php">php://input</link>, and
|
||||
<varname>$HTTP_RAW_POST_DATA</varname> is deprecated in PHP 5.6.0
|
||||
onwards. Setting <parameter>always_populate_raw_post_data</parameter>
|
||||
to <literal>-1</literal> will opt into the new behaviour that will be
|
||||
implemented in a future version of PHP, in which
|
||||
<varname>$HTTP_RAW_POST_DATA</varname> is never defined.
|
||||
</para>
|
||||
<para>
|
||||
Regardless of the setting, <varname>$HTTP_RAW_POST_DATA</varname> is
|
||||
not available with <literal>enctype="multipart/form-data"</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
@@ -1273,7 +1008,7 @@
|
||||
<entry><link linkend="ini.open-basedir">open_basedir</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>PHP_INI_SYSTEM in PHP < 5.3.0</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.doc-root">doc_root</link></entry>
|
||||
@@ -1291,13 +1026,13 @@
|
||||
<entry><link linkend="ini.user-ini.cache-ttl">user_ini.cache_ttl</link></entry>
|
||||
<entry>"300"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.3.0.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.user-ini.filename">user_ini.filename</link></entry>
|
||||
<entry>".user.ini"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.3.0.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.extension-dir">extension_dir</link></entry>
|
||||
@@ -1317,59 +1052,41 @@
|
||||
<entry>&php.ini; only</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.zend-extension-debug">zend_extension_debug</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>&php.ini; only</entry>
|
||||
<entry>Available before PHP 5.3.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.zend-extension-debug-ts">zend_extension_debug_ts</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>&php.ini; only</entry>
|
||||
<entry>Available before PHP 5.3.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.zend-extension-ts">zend_extension_ts</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>&php.ini; only</entry>
|
||||
<entry>Available before PHP 5.3.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.check-shebang-line">cgi.check_shebang_line</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.2.0.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.discard-path">cgi.discard_path</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.3.0.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.fix-pathinfo">cgi.fix_pathinfo</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>PHP_INI_ALL prior to PHP 5.2.1.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.force-redirect">cgi.force_redirect</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>PHP_INI_ALL prior to PHP 5.2.1.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.nph">cgi.nph</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.3.0.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.redirect-status-env">cgi.redirect_status_env</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>PHP_INI_ALL prior to PHP 5.2.1.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.cgi.rfc2616-headers">cgi.rfc2616_headers</link></entry>
|
||||
@@ -1381,13 +1098,13 @@
|
||||
<entry><link linkend="ini.fastcgi.impersonate">fastcgi.impersonate</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>PHP_INI_ALL prior to PHP 5.2.1.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.fastcgi.logging">fastcgi.logging</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>PHP_INI_ALL prior to PHP 5.2.1.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -1522,19 +1239,14 @@ include_path = ".:${USER}/pear/php"
|
||||
</para>
|
||||
<para>
|
||||
The restriction specified with <option>open_basedir</option> is a
|
||||
directory name since PHP 5.2.16 and 5.3.4. Previous versions used it
|
||||
as a prefix. This means that "<literal>open_basedir
|
||||
= /dir/incl</literal>" also allowed access to "<literal>/dir/include</literal>" and
|
||||
"<literal>/dir/incls</literal>" if they exist. When you want to restrict access
|
||||
to only the specified directory, end with a slash. For example:
|
||||
<literal>open_basedir = /dir/incl/</literal>
|
||||
directory name, not a prefix.
|
||||
</para>
|
||||
<para>
|
||||
The default is to allow all files to be opened.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
As of PHP 5.3.0 open_basedir can be tightened at run-time. This means
|
||||
open_basedir can be tightened at run-time. This means
|
||||
that if open_basedir is set to <literal>/www/</literal> in &php.ini;
|
||||
a script can tighten the configuration to
|
||||
<literal>/www/tmp/</literal> at run-time with
|
||||
@@ -1645,46 +1357,6 @@ include_path = ".:${USER}/pear/php"
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.zend-extension-debug">
|
||||
<term>
|
||||
<parameter>zend_extension_debug</parameter>
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Variant of <link linkend="ini.zend-extension">zend_extension</link>
|
||||
for extensions compiled with debug info prior to PHP 5.3.0.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.zend-extension-debug-ts">
|
||||
<term>
|
||||
<parameter>zend_extension_debug_ts</parameter>
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Variant of <link linkend="ini.zend-extension">zend_extension</link>
|
||||
for extensions compiled with debug info and thread safety prior to PHP
|
||||
5.3.0.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.zend-extension-ts">
|
||||
<term>
|
||||
<parameter>zend_extension_ts</parameter>
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Variant of <link linkend="ini.zend-extension">zend_extension</link>
|
||||
for extensions compiled with thread safety prior to PHP 5.3.0.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.cgi.check-shebang-line">
|
||||
<term>
|
||||
<parameter>cgi.check_shebang_line</parameter>
|
||||
@@ -1882,13 +1554,13 @@ include_path = ".:${USER}/pear/php"
|
||||
<entry><link linkend="ini.max-input-nesting-level">max_input_nesting_level</link></entry>
|
||||
<entry>64</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>Available since PHP 5.3.9.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.max-input-vars">max_input_vars</link></entry>
|
||||
<entry>1000</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>Available since PHP 5.3.9.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.upload-max-filesize">upload_max_filesize</link></entry>
|
||||
@@ -1900,7 +1572,7 @@ include_path = ".:${USER}/pear/php"
|
||||
<entry><link linkend="ini.max-file-uploads">max_file_uploads</link></entry>
|
||||
<entry>20</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Available since PHP 5.2.12.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -1999,7 +1671,7 @@ include_path = ".:${USER}/pear/php"
|
||||
<entry><link linkend="ini.sql.safe-mode">sql.safe_mode</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>Removed in PHP 7.2.0</entry>
|
||||
<entry>Removed as of PHP 7.2.0</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -2052,7 +1724,7 @@ include_path = ".:${USER}/pear/php"
|
||||
<entry><link linkend="ini.windows-show-crt-warning">windows.show_crt_warning</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>Available since PHP 5.4.0.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -2070,8 +1742,7 @@ include_path = ".:${USER}/pear/php"
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This directive shows the Windows CRT warnings when enabled. These
|
||||
warnings were displayed by default until PHP 5.4.0.
|
||||
This directive shows the Windows CRT warnings when enabled.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: c62c058b3ac2ce26432ec38fea3ee62bf0d60c22 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<sect1 xml:id="migration56.deprecated">
|
||||
@@ -47,15 +47,15 @@ B
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="migration56.deprecated.raw-post-data">
|
||||
<title><varname>$HTTP_RAW_POST_DATA</varname> 和 <link linkend="ini.always-populate-raw-post-data">always_populate_raw_post_data</link></title>
|
||||
<title><varname>$HTTP_RAW_POST_DATA</varname> 和 <literal>always_populate_raw_post_data</literal></title>
|
||||
|
||||
<para>
|
||||
使用 <link linkend="ini.always-populate-raw-post-data">always_populate_raw_post_data</link>
|
||||
使用 <literal>always_populate_raw_post_data</literal>
|
||||
会导致在填充 <varname>$HTTP_RAW_POST_DATA</varname> 时产生 <constant>E_DEPRECATED</constant> 错误。
|
||||
请使用 <link linkend="wrappers.php.input"><literal>php://input</literal></link> 替代
|
||||
<varname>$HTTP_RAW_POST_DATA</varname>,
|
||||
因为它可能在后续的 PHP 版本中被移除。
|
||||
设置 <link linkend="ini.always-populate-raw-post-data">always_populate_raw_post_data</link>
|
||||
设置 <literal>always_populate_raw_post_data</literal>
|
||||
为 <literal>-1</literal>
|
||||
(这样会强制 <varname>$HTTP_RAW_POST_DATA</varname> 未定义,所以也不回导致 <constant>E_DEPRECATED</constant> 的错误)
|
||||
来体验新的行为。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: b7a780f8e762e290552b9f79d346f2bcbc272e0c Maintainer: Jason Young Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: Jason Young Status: ready -->
|
||||
|
||||
<sect2 xml:id="migration70.incompatible.removed-ini-directives">
|
||||
<title>被移除掉的 INI 配置指令</title>
|
||||
@@ -15,12 +15,12 @@
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<link linkend="ini.always-populate-raw-post-data"><parameter>always_populate_raw_post_data</parameter></link>
|
||||
<parameter>always_populate_raw_post_data</parameter>
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<link linkend="ini.asp-tags"><parameter>asp_tags</parameter></link>
|
||||
<parameter>asp_tags</parameter>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 84b8fca68fc762fefe85acde180a38b2e77a28b9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: yes -->
|
||||
<!-- CREDITS: Gregory -->
|
||||
<chapter xml:id="tutorial" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
@@ -188,7 +188,8 @@
|
||||
linkend="language.variables.superglobals">超全局变量</link>”中的有关内容以获取更多信息。这些特殊的变量是在
|
||||
PHP <link xlink:href="&url.php.release4.1.0;">4.1.0</link> 版本引入的。在这之前使用
|
||||
<varname>$HTTP_*_VARS</varname> 数组,如
|
||||
<varname>$HTTP_SERVER_VARS</varname>。尽管现在已经不用了,但它们在新版本中仍然存在(参见“<link
|
||||
<varname>$HTTP_SERVER_VARS</varname>。自 PHP 5.4.0
|
||||
起,这些旧变量已经移除了。(参见“<link
|
||||
linkend="tutorial.oldcode">旧代码</link>”一节中的注解)。
|
||||
</para>
|
||||
</note>
|
||||
@@ -368,7 +369,7 @@ if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
|
||||
部分,这段程序做什么用显而易见。<function>htmlspecialchars</function>
|
||||
使得 HTML 之中的特殊字符被正确的编码,从而不会被使用者在页面注入 HTML 标签或者
|
||||
Javascript 代码。例如 age 字段,我们明确知道他是一个数值,因此我们将它<link
|
||||
linkend="language.types.typecasting">转换</link>为一个<type>整形值(integer)</type>来自动的消除任何不必要的字符。也可以使用 PHP 的 <link linkend="ref.filter">filter</link> 扩展来自动完成该工作。PHP
|
||||
linkend="language.types.typecasting">转换</link>为一个<type>int</type>来自动的消除任何不必要的字符。也可以使用 PHP 的 <link linkend="ref.filter">filter</link> 扩展来自动完成该工作。PHP
|
||||
将自动设置 <varname>$_POST['name']</varname> 和
|
||||
<varname>$_POST['age']</varname> 变量。在这之前我们使用了超全局变量
|
||||
<varname>$_SERVER</varname>,现在我们引入了超全局变量
|
||||
@@ -413,7 +414,7 @@ if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
|
||||
外部变量不再被默认注册为全局变量。也就是说,从
|
||||
PHP <link xlink:href="&url.php.release4.2.0;">4.2.0</link>
|
||||
版开始,&php.ini; 中的设置选项
|
||||
<link linkend="ini.register-globals">register_globals</link>
|
||||
<literal>register_globals</literal>
|
||||
默认值变成了
|
||||
<emphasis>off</emphasis>。建议用以上提到的超全局数组变量来访问这些值。但可能老的脚本、书籍以及教程都可能建立在该设置为
|
||||
on 的基础上。如果该选项被设置为
|
||||
|
||||
94
faq/misc.xml
94
faq/misc.xml
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: daijie Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: daijie Status: ready -->
|
||||
<!-- $Author$ -->
|
||||
<!-- $EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 $ -->
|
||||
<chapter xml:id="faq.misc"
|
||||
@@ -43,98 +43,6 @@
|
||||
<link xlink:href="&url.winzip;">WinZip</link>。</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
<qandaentry xml:id="faq.misc.arguments.references">
|
||||
<question>
|
||||
<para>在函数定义中,参数旁边的 & 是什么意思?例如
|
||||
<function>asort</function>。</para>
|
||||
</question>
|
||||
<answer>
|
||||
<para>这表示该参数是
|
||||
<link linkend="language.references.pass">引用传递</link>,该函数会修改其值。只可以用此方法传递变量,其实都不需要在函数调用中用 & 传递(此方式都已
|
||||
<link linkend="ini.allow-call-time-pass-reference">过时了</link>)。</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
<qandaentry xml:id="faq.misc.registerglobals">
|
||||
<question>
|
||||
<para>怎么处理
|
||||
<literal>register_globals</literal>?</para>
|
||||
</question>
|
||||
<answer>
|
||||
<para>有关
|
||||
<literal>register_globals</literal>实现方面的安全性,请阅读
|
||||
<link linkend="security.globals">使用 register_globals</link>一章。</para>
|
||||
<para>推荐使用
|
||||
<link linkend="language.variables.superglobals">超全局变量</link>而不要依赖
|
||||
<literal>register_globals</literal>。</para>
|
||||
<para>如果需要在一台关闭了
|
||||
<literal>register_globals</literal>的共享主机上运行一些旧式程序而该程序需要此选项打开时,或者在一些打开了此选项的主机上但想消除安全隐患,那么就需要用 PHP 来模拟出相反的设定。最好先问清楚是否能否在哪里更改 PHP 配置的选项,如果不行,那可以用如下的兼容手段。</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>模拟注册全局变量</title>
|
||||
<para>本例模拟 register_globals On。如果改变了配置文件中的
|
||||
<link linkend="ini.variables-order">variables_order</link>选项,则考虑对
|
||||
<varname>$superglobals</varname>作出相应的改动。</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Emulate register_globals on
|
||||
if (!ini_get('register_globals')) {
|
||||
$superglobals = array($_SERVER, $_ENV,
|
||||
$_FILES, $_COOKIE, $_POST, $_GET);
|
||||
if (isset($_SESSION)) {
|
||||
array_unshift($superglobals, $_SESSION);
|
||||
}
|
||||
foreach ($superglobals as $superglobal) {
|
||||
extract($superglobal, EXTR_SKIP);
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>本例模拟 register_globals Off。要记住此代码应在脚本最开头的地方调用。如果使用了会话机制,则在
|
||||
<function>session_start</function>之后调用。</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Emulate register_globals off
|
||||
function unregister_GLOBALS()
|
||||
{
|
||||
if (!ini_get('register_globals')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Might want to change this perhaps to a nicer error
|
||||
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
|
||||
die('GLOBALS overwrite attempt detected');
|
||||
}
|
||||
|
||||
// Variables that shouldn't be unset
|
||||
$noUnset = array('GLOBALS', '_GET',
|
||||
'_POST', '_COOKIE',
|
||||
'_REQUEST', '_SERVER',
|
||||
'_ENV', '_FILES');
|
||||
|
||||
$input = array_merge($_GET, $_POST,
|
||||
$_COOKIE, $_SERVER,
|
||||
$_ENV, $_FILES,
|
||||
isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
|
||||
|
||||
foreach ($input as $k => $v) {
|
||||
if (!in_array($k, $noUnset) && isset($GLOBALS[$k])) {
|
||||
unset($GLOBALS[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unregister_GLOBALS();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
</qandaset>
|
||||
</chapter>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- EN-Revision: f029b664b8728bd5cbb697cb9a4409aea07cb36c Maintainer: Avenger Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: Avenger Status: ready -->
|
||||
<chapter xml:id="faq.using"
|
||||
xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
@@ -99,68 +99,6 @@ if (empty($empty)) {
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry xml:id="faq.register-globals">
|
||||
<question>
|
||||
<para>
|
||||
PHP 选项 register_globals 对我有什么影响?
|
||||
</para>
|
||||
</question>
|
||||
<answer>
|
||||
&warn.deprecated.feature-5-3-0.removed-5-4-0;
|
||||
<para>
|
||||
首先要理解这个设置选项的作用。假如我们使用以下 URL:
|
||||
<literal>http://example.com/foo.php?animal=cat</literal>,那么在
|
||||
<filename>foo.php</filename>中我们可能会使用以下代码:</para>
|
||||
|
||||
|
||||
|
||||
<para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// 建议使用这种访问变量的方式
|
||||
echo $_GET['animal'];
|
||||
|
||||
// 如果想直接访问 $animal 变量,就要把 register_globals 选项设置为 on
|
||||
// 强烈建议不要这么做!!
|
||||
echo $animal;
|
||||
|
||||
// 这个选项的值会影响到所有变量,包括 $_SERVER
|
||||
echo $_SERVER['PHP_SELF'];
|
||||
|
||||
// 同样,要使 $PHP_SELF 变量自动生效,register_globals 选项必须设置为 on
|
||||
// 强烈建议不要这么做!!
|
||||
echo $PHP_SELF;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
上面的代码解释了 register_globals 的作用,就是自动生成变量。多年来,这种编程方式被很多人所不喜,所以从
|
||||
PHP 6 开始,这个选项就被禁用了。目前市面上绝大部分虚拟主机服务商也都默认把
|
||||
register_globals 禁用,但是请注意,你在阅读一些过时的资料时,可能仍有一些文章、教程、书籍要求把该选项开启。不用管它!
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
请参阅以下资源进一步了解:
|
||||
<simplelist>
|
||||
<member><link linkend="ini.register-globals">register_globals</link> 选项说明</member>
|
||||
<member><link linkend="security.globals">注册全局变量的安全问题</link></member>
|
||||
<member><link linkend="language.variables.external">处理外部变量</link></member>
|
||||
<member>使用 <link linkend="language.variables.superglobals">超级全局变量</link> 的替代方案</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
以上示例中,我们使用了一个 <acronym>URL</acronym>,其中包含了一个 QUERY_STRING。PHP 会把
|
||||
QUERY_STRING 中的信息通过 GET HTTP 请求传递,所以我们可以通过超级全局变量(superglobal)
|
||||
<varname>$_GET</varname> 来访问其中的变量。
|
||||
</para>
|
||||
</note>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry xml:id="faq.using.wrong-order">
|
||||
<question>
|
||||
<para>
|
||||
@@ -392,25 +330,12 @@ foreach ($headers as $name => $content) {
|
||||
<varname>$HTTP_REFERER</varname>),但是找不到,哪里出了错?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<answer>
|
||||
<para>
|
||||
首先非常重要的一点是 PHP 设置项 <link
|
||||
linkend="ini.register-globals">register_globals</link> 同样会对服务器端和环境变量产生影响。当
|
||||
register_globals = off (从 PHP 4.2.0 开始其默认值为 off),变量
|
||||
<varname>$DOCUMENT_ROOT</varname> 将不会存在,而只有
|
||||
<varname>$_SERVER['DOCUMENT_ROOT']</varname>。如果 register_globals = on 则变量
|
||||
<varname>$DOCUMENT_ROOT</varname> 和
|
||||
<varname>$GLOBALS['DOCUMENT_ROOT']</varname> 将同时存在。
|
||||
使用 <varname>$_SERVER['DOCUMENT_ROOT']</varname> 和
|
||||
<varname>$_SERVER['HTTP_REFERER']</varname> 替代。
|
||||
</para>
|
||||
<para>
|
||||
如果确认 register_globals = on 但不知道为什么
|
||||
<varname>$DOCUMENT_ROOT</varname> 在函数内部不可用,这是因为它和其它的变量一样需要在函数中执行
|
||||
<literal>global $DOCUMENT_ROOT</literal>。请参阅手册中的
|
||||
<link linkend="language.variables.scope">变量范围</link> 一节。建议在 register_globals = off 的情况下进行编码。
|
||||
</para>
|
||||
|
||||
</answer>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- Reviewed: no Maintainer: 徐骁 -->
|
||||
<!-- EN-Revision: f1fc80fc2d0900ce8a563013224f2c4ca609144d Maintainer: thomaslio Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: thomaslio Status: ready -->
|
||||
<!-- CREDITS: Gregory -->
|
||||
<chapter xml:id="features.cookies" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>Cookie</title>
|
||||
@@ -27,12 +27,6 @@
|
||||
cookie 变量设置多个值,则需在 cookie 的名称后加 <literal>[]</literal> 符号。
|
||||
</para>
|
||||
|
||||
<para>
|
||||
根据 <link linkend="ini.register-globals">register_globals</link>
|
||||
的设置,可以从 cookie 建立普通的 PHP
|
||||
变量。但是不推荐依赖于此特性,因为出于安全原因此选项通常是关闭的。
|
||||
</para>
|
||||
|
||||
<para>
|
||||
关于更多细节以及有关浏览器问题的注意事项,参见 <function>setcookie</function>
|
||||
和 <function>setrawcookie</function> 函数。
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- EN-Revision: n/a Maintainer: Gregory Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: Gregory Status: ready -->
|
||||
<!-- CREDITS: dallas -->
|
||||
<chapter xml:id="features.file-upload" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>文件上传处理</title>
|
||||
|
||||
<sect1 xml:id="features.file-upload.post-method">
|
||||
<title>POST 方法上传</title>
|
||||
|
||||
<simpara>
|
||||
本特性可以使用户上传文本和二进制文件。用 PHP
|
||||
的认证和文件操作函数,可以完全控制允许哪些人上传以及文件上传后怎样处理。
|
||||
</simpara>
|
||||
<simpara>
|
||||
PHP 能够接受任何来自符合 RFC-1867 标准的浏览器(包括
|
||||
<productname>Netscape Navigator 3</productname> 及更高版本,打了补丁的
|
||||
<productname>Microsoft Internet Explorer 3</productname> 或者更高版本)上传的文件。
|
||||
PHP 能够接受任何来自符合 RFC-1867 标准的浏览器上传的文件。
|
||||
</simpara>
|
||||
|
||||
<note>
|
||||
<title>相关的设置</title>
|
||||
<para>
|
||||
@@ -29,6 +27,7 @@
|
||||
以及 <link linkend="ini.max-input-time">max_input_time</link> 设置选项。
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
请注意 PHP 也支持 PUT 方法的文件上传,<productname>Netscape Composer</productname>
|
||||
和 W3C 的 <productname>Amaya</productname> 客户端使用这种方法。请参阅<link
|
||||
@@ -41,8 +40,6 @@
|
||||
可以如下建立一个特殊的表单来支持文件上传:
|
||||
</para>
|
||||
<programlisting role="html">
|
||||
<!-- The HTML comments in this example code are stripped.
|
||||
This needs to be fixed in livedocs. -->
|
||||
<![CDATA[
|
||||
<!-- The data encoding type, enctype, MUST be specified as below -->
|
||||
<form enctype="multipart/form-data" action="__URL__" method="POST">
|
||||
@@ -74,14 +71,8 @@
|
||||
</note>
|
||||
|
||||
<para>
|
||||
全局变量 <link linkend="reserved.variables.files">$_FILES</link>
|
||||
自 PHP 4.1.0 起存在(在更早的版本中用
|
||||
<varname>$HTTP_POST_FILES</varname> 替代)。此数组包含有所有上传的文件信息。
|
||||
</para>
|
||||
|
||||
<para>
|
||||
以上范例中 <link linkend="reserved.variables.files">$_FILES</link>
|
||||
数组的内容如下所示。我们假设文件上传字段的名称如上例所示,为
|
||||
全局变量 <varname>$_FILES</varname> 包含有所有上传的文件信息。
|
||||
数组的内容来自以下范例表单。我们假设文件上传字段的名称如下例所示,为
|
||||
<emphasis>userfile</emphasis>。名称可随意命名。
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@@ -122,8 +113,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
和该文件上传相关的<link
|
||||
linkend="features.file-upload.errors">错误代码</link>。此项目是在
|
||||
PHP 4.2.0 版本中增加的。
|
||||
linkend="features.file-upload.errors">错误代码</link>。
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -138,16 +128,15 @@
|
||||
PHP 脚本内部通过运行 <function>putenv</function>
|
||||
函数来设置是不起作用的。该环境变量也可以用来确认其它的操作也是在上传的文件上进行的。
|
||||
<example>
|
||||
<title>使文件上传生效</title>
|
||||
<title>验证上传的文件</title>
|
||||
<para>
|
||||
请查阅函数 <function>is_uploaded_file</function> 和 <function>move_uploaded_file</function> 以获取进一步的信息。以下范例处理由表单提供的文件上传。
|
||||
请查阅函数 <function>is_uploaded_file</function> 和
|
||||
<function>move_uploaded_file</function> 以获取进一步的信息。
|
||||
以下范例处理由表单提供的文件上传。
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
|
||||
// of $_FILES.
|
||||
|
||||
$uploaddir = '/var/www/uploads/';
|
||||
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
|
||||
|
||||
@@ -175,7 +164,7 @@ print "</pre>";
|
||||
变量来排除过大或过小的文件,也可以通过
|
||||
<varname>$_FILES['userfile']['type']</varname>
|
||||
变量来排除文件类型和某种标准不相符合的文件,但只把这个当作一系列检查中的第一步,因为此值完全由客户端控制而在
|
||||
PHP 端并不检查。自 PHP 4.2.0 起,还可以通过
|
||||
PHP 端并不检查。同时,还可以通过
|
||||
<varname>$_FILES['userfile']['error']</varname> 变量来根据不同的<link
|
||||
linkend="features.file-upload.errors">错误代码</link>来计划下一步如何处理。不管怎样,要么将该文件从临时目录中删除,要么将其移动到其它的地方。
|
||||
</simpara>
|
||||
@@ -211,7 +200,9 @@ print "</pre>";
|
||||
foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
if ($error == UPLOAD_ERR_OK) {
|
||||
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
|
||||
$name = $_FILES["pictures"]["name"][$key];
|
||||
// basename() may prevent filesystem traversal attacks;
|
||||
// further validation/sanitation of the filename may be appropriate
|
||||
$name = basename($_FILES["pictures"]["name"][$key]);
|
||||
move_uploaded_file($tmp_name, "data/$name");
|
||||
}
|
||||
}
|
||||
@@ -219,12 +210,16 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
File upload progress bar can be implemented using <link
|
||||
linkend="session.upload-progress">Session Upload Progress</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="features.file-upload.errors">
|
||||
<title>错误信息说明</title>
|
||||
<simpara>
|
||||
从 PHP 4.2.0 开始,PHP
|
||||
PHP
|
||||
将随文件信息数组一起返回一个对应的错误代码。该代码可以在文件上传时生成的文件数组中的
|
||||
<literal>error</literal> 字段中被找到,也就是
|
||||
<varname>$_FILES['userfile']['error']</varname>。
|
||||
@@ -277,7 +272,7 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
<term><constant>UPLOAD_ERR_NO_TMP_DIR</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
其值为 6,找不到临时文件夹。PHP 4.3.10 和 PHP 5.0.3 引进。
|
||||
其值为 6,找不到临时文件夹。PHP 5.0.3 引进。
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -289,19 +284,25 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><constant>UPLOAD_ERR_EXTENSION</constant></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Value: 8; A PHP extension stopped the file upload. PHP does not
|
||||
provide a way to ascertain which extension caused the file upload to
|
||||
stop; examining the list of loaded extensions with <function>phpinfo</function> may help.
|
||||
Introduced in PHP 5.2.0.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
以上值在 PHP 4.3.0 之后变成了 PHP 常量。
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="features.file-upload.common-pitfalls">
|
||||
<title>常见缺陷</title>
|
||||
<simpara>
|
||||
对 <literal>MAX_FILE_SIZE</literal> 设置的值,不能大于 ini
|
||||
对 <literal>MAX_FILE_SIZE</literal> 设置的值,不能大于 &php.ini; 文件
|
||||
设置中 <link linkend="ini.upload-max-filesize">upload_max_filesize</link>
|
||||
选项设置的值。其默认值为 2M 字节。
|
||||
</simpara>
|
||||
@@ -338,6 +339,17 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
设置的值太小,则较大的文件会无法被上传。因此,请保证
|
||||
<literal>post_max_size</literal> 的值足够的大。
|
||||
</simpara>
|
||||
<simpara>
|
||||
As of PHP 5.2.12, the
|
||||
<link linkend="ini.max-file-uploads">max_file_uploads</link> configuration
|
||||
setting controls the maximum number of files that can uploaded in one
|
||||
request. If more files are uploaded than the limit, then
|
||||
<varname>$_FILES</varname> will stop processing files once the limit is
|
||||
reached. For example, if
|
||||
<link linkend="ini.max-file-uploads">max_file_uploads</link> is set to
|
||||
<literal>10</literal>, then <varname>$_FILES</varname> will never contain
|
||||
more than 10 items.
|
||||
</simpara>
|
||||
<simpara>
|
||||
不对正在操作的文件进行验证可能意味着用户能够访问其它目录下的敏感信息。
|
||||
</simpara>
|
||||
@@ -351,7 +363,7 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
鉴于文件路径的表示方法有很多种,我们无法确保用使用各种外语的文件名(尤其是包含空格的)能够被正确的处理。
|
||||
</simpara>
|
||||
<simpara>
|
||||
开发人员不应将普通的输入字段和文件上传的字段混用同一个表单变量(例如都用
|
||||
开发人员不应将普通的 <literal>input</literal> 输入字段和文件上传的字段混用同一个表单变量(例如 <literal>input</literal> 名都用
|
||||
<literal>foo[]</literal>)。
|
||||
</simpara>
|
||||
</sect1>
|
||||
@@ -365,11 +377,6 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
PHP 支持同时上传多个文件并将它们的信息自动以数组的形式组织。要完成这项功能,需要在
|
||||
HTML 表单中对文件上传域使用和多选框与复选框相同的数组式提交语法。
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
对多文件上传的支持是在 PHP 3.0.10 版本添加的。
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
<example>
|
||||
<title>上传多个文件</title>
|
||||
@@ -388,10 +395,7 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
<simpara>
|
||||
当以上表单被提交后,数组
|
||||
<varname>$_FILES['userfile']</varname>,<varname>$_FILES['userfile']['name']</varname>
|
||||
和 <varname>$_FILES['userfile']['size']</varname> 将被初始化(在
|
||||
PHP 4.1.0 以前版本是 <varname>$HTTP_POST_FILES</varname>)。如果
|
||||
<link linkend="ini.register-globals">register_globals</link>
|
||||
的设置为 on,则和文件上传相关的全局变量也将被初始化。所有这些提交的信息都将被储存到以数字为索引的数组中。
|
||||
和 <varname>$_FILES['userfile']['size']</varname> 将被初始化。
|
||||
</simpara>
|
||||
<simpara>
|
||||
例如,假设名为 <filename>/home/test/review.html</filename> 和
|
||||
@@ -403,25 +407,74 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
|
||||
将包含文件 <filename>review.html</filename> 的大小,依此类推。
|
||||
</simpara>
|
||||
<simpara>
|
||||
此外也同时设置了 <varname>$_FILES['userfile']['name'][0]</varname>,<varname>$_FILES['userfile']['tmp_name'][0]</varname>,<varname>$_FILES['userfile']['size'][0]</varname>
|
||||
此外也同时设置了 <varname>$_FILES['userfile']['name'][0]</varname>,
|
||||
<varname>$_FILES['userfile']['tmp_name'][0]</varname>,
|
||||
<varname>$_FILES['userfile']['size'][0]</varname>
|
||||
以及 <varname>$_FILES['userfile']['type'][0]</varname>。
|
||||
</simpara>
|
||||
<warning>
|
||||
<simpara>
|
||||
As of PHP 5.2.12, the
|
||||
<link linkend="ini.max-file-uploads">max_file_uploads</link>
|
||||
configuration setting acts as a limit on the number of files that can be
|
||||
uploaded in one request. You will need to ensure that your form does not
|
||||
try to upload more files in one request than this limit.
|
||||
</simpara>
|
||||
</warning>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="features.file-upload.put-method">
|
||||
<title>对 PUT 方法的支持</title>
|
||||
<para>
|
||||
PHP 对部分客户端具备的
|
||||
HTTP PUT 方法提供了支持。PUT 请求比文件上传要简单的多,它们一般的形式为:
|
||||
<informalexample>
|
||||
<programlisting role="HTTP">
|
||||
<![CDATA[
|
||||
PUT /path/filename.html HTTP/1.1
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
这通常意味着远程客户端会将其中的 <filename>/path/filename.html</filename>
|
||||
存储到 web 目录树。让 Apache 或者 PHP 自动允许所有人覆盖
|
||||
web 目录树下的任何文件显然是很不明智的。因此,要处理类似的请求,必须先告诉
|
||||
web 服务器需要用特定的 PHP 脚本来处理该请求。在 Apache 下,可以用
|
||||
<emphasis>Script</emphasis> 选项来设置。它可以被放置到
|
||||
Apache 配置文件中几乎所有的位置。通常我们把它放置在
|
||||
<literal><Directory></literal> 区域或者 <literal><VirtualHost></literal> 区域。可以用如下一行来完成该设置:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Script PUT /put.php
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<simpara>
|
||||
PHP 3 和 PHP 4 对 PUT 方法的支持有所不同。在 PHP 4
|
||||
中,必须使用标准的输入流来读取一个 HTTP PUT 的内容。
|
||||
这将告诉 Apache 将所有对 URI 的 PUT 请求全部发送到 <filename>put.php</filename> 脚本,这些
|
||||
URI 必须和 PUT 命令中的内容相匹配。当然,这是建立在 PHP 支持
|
||||
<filename>.php</filename> 扩展名,并且 PHP 已经在运行的假设之上。
|
||||
The destination resource for all PUT
|
||||
requests to this script has to be the script itself, not a filename the
|
||||
uploaded file should have.
|
||||
</simpara>
|
||||
<simpara>
|
||||
With PHP you would then do something like the following in
|
||||
your put.php. This would copy the contents of the uploaded file to the
|
||||
file <filename>myputfile.ext</filename> on the server.
|
||||
You would probably want to perform some checks and/or
|
||||
authenticate the user before performing this file copy.
|
||||
</simpara>
|
||||
<para>
|
||||
<example>
|
||||
<title>用 PHP 4 来保存 HTTP PUT 文件</title>
|
||||
<title>保存 HTTP PUT 文件</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* PUT data comes in on the stdin stream */
|
||||
$putdata = fopen("php://stdin", "r");
|
||||
$putdata = fopen("php://input", "r");
|
||||
|
||||
/* Open a file for writing */
|
||||
$fp = fopen("myputfile.ext", "w");
|
||||
@@ -439,65 +492,15 @@ fclose($putdata);
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
以下文档的内容仅对 PHP 3 适用。
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="features.file-upload.errors.seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
PHP 提供对诸如 <productname>Netscape Composer</productname>
|
||||
和 W3C <productname>Amaya</productname> 等客户端使用的
|
||||
HTTP PUT 方法的支持。PUT 请求比文件上传要简单的多,它们一般的形式为:
|
||||
<informalexample>
|
||||
<programlisting role="HTTP">
|
||||
<![CDATA[
|
||||
PUT /path/filename.html HTTP/1.1
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
<simplelist>
|
||||
<member><link linkend="security.filesystem">文件系统安全</link></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
<para>
|
||||
这通常意味着远程客户端会将其中的 <filename>/path/filename.html</filename>
|
||||
存储到 web 目录树。让 Apache 或者 PHP 自动允许所有人覆盖
|
||||
web 目录树下的任何文件显然是很不明智的。因此,要处理类似的请求,必须先告诉
|
||||
web 服务器需要用特定的 PHP 脚本来处理该请求。在 Apache 下,可以用
|
||||
<emphasis>Script</emphasis> 选项来设置。它可以被放置到
|
||||
Apache 配置文件中几乎所有的位置。通常我们把它放置在
|
||||
<Directory> 区域或者 <Virtualhost> 区域。可以用如下一行来完成该设置:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Script PUT /put.php
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<simpara>
|
||||
这将告诉 Apache 将所有对 URI 的 PUT 请求全部发送到 put.php 脚本,这些
|
||||
URI 必须和 PUT 命令中的内容相匹配。当然,这是建立在 PHP 支持
|
||||
.php 扩展名,并且 PHP 已经在运行的假设之上。
|
||||
</simpara>
|
||||
<simpara>
|
||||
在 put.php 文件中,可以作如下操作:
|
||||
</simpara>
|
||||
<para>
|
||||
<informalexample><programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php copy($PHP_UPLOADED_FILE_NAME, $DOCUMENT_ROOT . $REQUEST_URI); ?>
|
||||
]]>
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<simpara>
|
||||
这将会把文件拷贝到远程客户端请求的位置。可能希望在文件拷贝之前进行一些检查或者对用户认证之类的操作。这里唯一的问题是,当
|
||||
PHP 接受到 PUT 方法的请求时,它将会把上传的文件储存到和其它用
|
||||
<link linkend="features.file-upload.post-method">POST
|
||||
方法</link>处理过的文件相同的临时目录。在请求结束时,临时文件将被删除。因此,用来处理
|
||||
PUT 的 PHP 脚本必须将该文件拷贝到其它的地方。该临时文件的文件名被储存在变量
|
||||
<varname>$PHP_PUT_FILENAME</varname> 中,也可以通过
|
||||
<varname>$REQUEST_URI</varname> 变量获得建议的目标文件名(在非
|
||||
Apache web 服务器上可能会有较大的变化)。该目标文件名是由远程客户端指定的。也可以不听从改客户端的信息,而把所有上传的文件存储到一个特殊的上传目录下。
|
||||
</simpara>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- EN-Revision: f7eec8e460993235c050632502bc84d4c077cd17 Maintainer: Avenger Status: ready -->
|
||||
<!-- EN-Revision: f1b211f5c87d97a1a636c0022e701db18fb73eff Maintainer: Avenger Status: ready -->
|
||||
<sect2 xml:id="install.windows.legacy.extensions" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>Windows 下安装扩展库</title>
|
||||
<para>
|
||||
@@ -153,11 +153,6 @@ extension=php_bz2.dll
|
||||
<entry><link linkend="book.dbase">dBase</link> 函数</entry>
|
||||
<entry>无</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>php_dbx.dll</entry>
|
||||
<entry><link linkend="book.dbx">dbx</link> 函数</entry>
|
||||
<entry>无</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>php_exif.dll</entry>
|
||||
<entry><link linkend="book.exif">EXIF</link> 函数</entry>
|
||||
@@ -253,11 +248,6 @@ extension=php_bz2.dll
|
||||
<entry><link linkend="book.mhash">Mhash</link> 函数</entry>
|
||||
<entry>需要:<filename>libmhash.dll</filename>(已附带)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>php_mime_magic.dll</entry>
|
||||
<entry><link linkend="book.mime-magic">Mimetype</link> 函数</entry>
|
||||
<entry>需要:<filename>magic.mime</filename>(已附带)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>php_mysql.dll</entry>
|
||||
<entry><link linkend="book.mysql">MySQL</link> 函数</entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: d278431ef5e561787093a7b2679327a615b09367 Maintainer: Gregory Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: Gregory Status: ready -->
|
||||
<!-- Reviewed: yes -->
|
||||
<!-- CREDITS: dallas -->
|
||||
<!-- 请保持此文件与英文文件中相应的每个 ENTITY 行号一一对应以便于对照,修改与更新! -->
|
||||
@@ -101,7 +101,7 @@ linkend="features.remote-files">远程文件</link>,被检查的文件必须
|
||||
|
||||
<!ENTITY note.registerglobals '<note xmlns="http://docbook.org/ns/docbook"><title>register_globals 重要说明:</title>
|
||||
<para>自 PHP 4.2.0 起,PHP 指令
|
||||
<link linkend="ini.register-globals">register_globals</link> 的默认值为 <emphasis>off</emphasis>。PHP
|
||||
<literal>register_globals</literal> 的默认值为 <emphasis>off</emphasis>。PHP
|
||||
社区鼓励开发者不要依赖于此指令, 用其他手段替代,例如&link.superglobals;。</para></note>'>
|
||||
|
||||
|
||||
@@ -115,6 +115,10 @@ linkend="features.remote-files">远程文件</link>,被检查的文件必须
|
||||
参数时,本函数使用其内部输出缓冲,因此不能在
|
||||
<function>ob_start</function> 回调函数的内部使用。</para></note>'>
|
||||
|
||||
<!ENTITY note.uses-ob-php70 '<note xmlns="http://docbook.org/ns/docbook"><para>When the <parameter>return</parameter> parameter
|
||||
is used, this function uses internal output buffering prior to PHP 7.1.0, so it cannot be used inside an
|
||||
<function>ob_start</function> callback function.</para></note>'>
|
||||
|
||||
<!ENTITY note.filesystem-time-res '<note xmlns="http://docbook.org/ns/docbook"><para>注意:不同文件系统对时间的判断方法可能是不相同的。</para></note>'>
|
||||
|
||||
|
||||
@@ -233,6 +237,10 @@ PHP 7.2.0 起<emphasis>移除</emphasis>。强烈建议不要使用本函数。<
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>本特性已自 PHP 7.2.0
|
||||
起<emphasis>废弃</emphasis>。强烈建议不要使用本特性。</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.feature-7-2-0.removed-8-0-0 '<warning
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>This feature has been
|
||||
<emphasis>DEPRECATED</emphasis> as of PHP 7.2.0, and <emphasis>REMOVED</emphasis> as of PHP 8.0.0. Relying on this feature
|
||||
is highly discouraged.</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.function-7-2-0 '<warning
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>本函数已自 PHP 7.2.0
|
||||
@@ -252,6 +260,10 @@ xmlns="http://docbook.org/ns/docbook"><simpara>本特性已自 PHP 7.3.0
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>本函数已自 PHP 7.3.0
|
||||
起<emphasis>废弃</emphasis>。强烈建议不要使用本函数。</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.function-7-3-0.removed-8-0-0 '<warning
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>This function has been
|
||||
<emphasis>DEPRECATED</emphasis> as of PHP 7.3.0, and <emphasis>REMOVED</emphasis> as of PHP 8.0.0. Relying on this function
|
||||
is highly discouraged.</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.feature-7-4-0 '<warning
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>本特性已自 PHP 7.4.0
|
||||
@@ -262,6 +274,11 @@ xmlns="http://docbook.org/ns/docbook"><simpara>本特性已自 PHP 7.4.0
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>本函数已自 PHP 7.4.0
|
||||
起<emphasis>废弃</emphasis>。强烈建议不要使用本函数。</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.function-7-4-0.removed-8-0-0 '<warning
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>This function has been
|
||||
<emphasis>DEPRECATED</emphasis> as of PHP 7.4.0, and <emphasis>REMOVED</emphasis> as of PHP 8.0.0. Relying on this function
|
||||
is highly discouraged.</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.function-8-0-0 '<warning
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>本函数已自 PHP 8.0.0
|
||||
起被<emphasis>废弃</emphasis>。强烈建议不要依赖本函数。</simpara></warning>'>
|
||||
@@ -325,6 +342,9 @@ xmlns="http://docbook.org/ns/docbook"><simpara>该函数已在 PHP 7.0.0 中
|
||||
xmlns="http://docbook.org/ns/docbook"><simpara>该函数已在 PHP 7.4.0 中
|
||||
<emphasis>移除</emphasis>。</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.alias-7-2-0.removed-8-0-0 '<warning xmlns="http://docbook.org/ns/docbook"><simpara>This alias was
|
||||
<emphasis>DEPRECATED</emphasis> in PHP 7.2.0, and <emphasis>REMOVED</emphasis> as of PHP 8.0.0.</simpara></warning>'>
|
||||
|
||||
<!ENTITY warn.deprecated.alias-7-4-0.removed-8-0-0 '<warning xmlns="http://docbook.org/ns/docbook"><simpara>该别名已在 PHP 7.4.0 中
|
||||
<emphasis>废弃</emphasis>,并且自 PHP 8.0.0 起已被<emphasis>移除</emphasis>。</simpara></warning>'>
|
||||
|
||||
@@ -506,6 +526,8 @@ PHP 4.3.7 及更高版本可以在使用 <literal>https://</literal> 包装器
|
||||
|
||||
<!ENTITY example.outputs.8 '<para xmlns="http://docbook.org/ns/docbook">以上例程在 PHP 8 中的输出:</para>'>
|
||||
|
||||
<!ENTITY example.outputs.8.similar '<para xmlns="http://docbook.org/ns/docbook">Output of the above example in PHP 8 is similar to:</para>'>
|
||||
|
||||
<!ENTITY example.outputs.80 '<para xmlns="http://docbook.org/ns/docbook">以上例程在 PHP 8.0 中的输出:</para>'>
|
||||
|
||||
<!ENTITY example.outputs.32bit '<para xmlns="http://docbook.org/ns/docbook">以上例程在 32 位机器上的输出:</para>'>
|
||||
@@ -578,7 +600,7 @@ PHP 4.3.7 及更高版本可以在使用 <literal>https://</literal> 包装器
|
||||
'>
|
||||
|
||||
<!ENTITY avail.register-long-arrays '自 PHP 5.0.0 起, 用
|
||||
<link xmlns="http://docbook.org/ns/docbook" linkend="ini.register-long-arrays">register_long_arrays</link> 设置选项可禁用
|
||||
<literal>register_long_arrays</literal> 设置选项可禁用
|
||||
长类型的 PHP <link xmlns="http://docbook.org/ns/docbook" linkend="language.variables.predefined">预定义变量</link>数组。'>
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: e392d576edd328d2c1340a560bfa8c632e1a7c90 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: cdaea0421544885f02ff3d36bd203dc01b78299e Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.server" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
<refname>$_SERVER</refname>
|
||||
<refname>$HTTP_SERVER_VARS [已删除]</refname>
|
||||
<refname>Server and execution environment information</refname>
|
||||
<refpurpose>服务器和执行环境信息</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
<para>
|
||||
<varname>$_SERVER</varname> 是一个包含了诸如头信息(header)、路径(path)、以及脚本位置(script locations)等等信息的数组。这个数组中的项目由 Web 服务器创建。不能保证每个服务器都提供全部项目;服务器可能会忽略一些,或者提供一些没有在这里列举出来的项目。这也就意味着大量的此类变量都会在<link xlink:href="&url.rfc;3875">CGI 1.1 规范</link>中说明,所以应该仔细研究一下。
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
PHP 5.4.0 之前,<varname>$HTTP_SERVER_VARS</varname> 包含着相同的信息,但它不是一个<link linkend="language.variables.superglobals">超全局变量</link>。
|
||||
(注意 <varname>$HTTP_SERVER_VARS</varname> 与 <varname>$_SERVER</varname> 是不同的变量,PHP处理它们的方式不同)
|
||||
</simpara>
|
||||
</note>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -40,7 +34,7 @@
|
||||
当前执行脚本的文件名,与 document root 有关。例如,在地址为 <filename>http://example.com/foo/bar.php</filename> 的脚本中使用 <varname>$_SERVER['PHP_SELF']</varname> 将得到 <filename>/foo/bar.php</filename>。<link linkend="language.constants.predefined">__FILE__</link> 常量包含当前(例如包含)文件的完整路径和文件名。
|
||||
</simpara>
|
||||
<simpara>
|
||||
从 PHP 4.3.0 版本开始,如果 PHP 以命令行模式运行,这个变量将包含脚本名。之前的版本该变量不可用。
|
||||
如果 PHP 以命令行模式运行,这个变量将包含脚本名。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -134,7 +128,7 @@
|
||||
<term>'<varname>REQUEST_TIME</varname>'</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
请求开始时的时间戳。从 PHP 5.1.0 起可用。
|
||||
请求开始时的时间戳。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -144,7 +138,6 @@
|
||||
<listitem>
|
||||
<simpara>
|
||||
请求开始时的时间戳,微秒级别的精准度。
|
||||
自 PHP 5.4.0 开始生效。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -246,11 +239,6 @@
|
||||
<simpara>
|
||||
如果脚本是通过 HTTPS 协议被访问,则被设为一个非空的值。
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
注意当使用 IIS 上的 ISAPI 方式时,如果不是通过 HTTPS 协议被访问,这个值将为 <literal>off</literal>。
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -357,9 +345,6 @@
|
||||
当前脚本所在文件系统(非文档根目录)的基本路径。这是在服务器进行虚拟到真实路径的映像后的结果。
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
自 PHP 4.3.2 起,<envar>PATH_TRANSLATED</envar> 在 Apache 2 <acronym>SAPI</acronym> 模式下不再和 Apache 1 一样隐含赋值,而是若 Apache 不生成此值,PHP 便自己生成并将其值放入 <envar>SCRIPT_FILENAME</envar> 服务器常量中。这个修改遵守了 <acronym>CGI</acronym> 规范,<envar>PATH_TRANSLATED</envar> 仅在 <envar>PATH_INFO</envar> 被定义的条件下才存在。
|
||||
</simpara>
|
||||
<simpara>
|
||||
Apache 2 用户可以在 <filename>httpd.conf</filename> 中设置 <literal>AcceptPathInfo = On</literal> 来定义 <envar>PATH_INFO</envar>。
|
||||
</simpara>
|
||||
@@ -442,37 +427,7 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.4.0</entry>
|
||||
<entry>
|
||||
因为移除了 long array register 功能,<varname>$HTTP_SERVER_VARS</varname> 不再有效。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.3.0</entry>
|
||||
<entry>
|
||||
废弃了使 <varname>$HTTP_SERVER_VARS</varname> 生效的 <link linkend="ini.register-long-arrays">register_long_arrays</link> 指令。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: af6fdf16ab44bcf4d045407963e43c3d9dd2ff29 Maintainer: daijie Status: ready -->
|
||||
<!-- EN-Revision: cdaea0421544885f02ff3d36bd203dc01b78299e Maintainer: daijie Status: ready -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="language.variables.superglobals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<refnamediv>
|
||||
@@ -38,16 +38,6 @@
|
||||
<link linkend="ini.variables-order">variables_order</link>.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>处理 register_globals</title>
|
||||
<para>
|
||||
如果已经弃用的 <link linkend="ini.register-globals">register_globals</link> 指令被设置为 <literal>on</literal> 那么局部变量也将在脚本的全局作用域中可用。例如,
|
||||
<varname>$_POST['foo']</varname> 也将以 <varname>$foo</varname> 的形式存在。
|
||||
</para>
|
||||
<para>
|
||||
相关信息,参见 FAQ “<link linkend="faq.register-globals">register_globals 对我有什么影响?</link>”
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>可变变量</title>
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: af6fdf16ab44bcf4d045407963e43c3d9dd2ff29 Maintainer: daijie Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: daijie Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="wrappers.php" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
@@ -44,21 +44,11 @@
|
||||
<filename>php://input</filename> 是个可以访问请求的原始数据的只读流。
|
||||
POST 请求的情况下,最好使用 <filename>php://input</filename> 来代替 <varname>$HTTP_RAW_POST_DATA</varname>,因为它不依赖于特定的 &php.ini; 指令。
|
||||
而且,这样的情况下 <varname>$HTTP_RAW_POST_DATA</varname> 默认没有填充,
|
||||
比激活 <link
|
||||
linkend="ini.always-populate-raw-post-data">always_populate_raw_post_data</link>
|
||||
比激活 <literal>always_populate_raw_post_data</literal>
|
||||
潜在需要更少的内存。
|
||||
<literal>enctype="multipart/form-data"</literal> 的时候
|
||||
<filename>php://input</filename> 是无效的。
|
||||
</simpara>
|
||||
<note>
|
||||
<simpara>
|
||||
在 PHP 5.6 之前 <filename>php://input</filename> 打开的数据流只能读取一次;
|
||||
数据流不支持 seek 操作。
|
||||
不过,依赖于 SAPI 的实现,请求体数据被保存的时候,
|
||||
它可以打开另一个 <filename>php://input</filename> 数据流并重新读取。
|
||||
通常情况下,这种情况只是针对 POST 请求,而不是其他请求方式,比如 PUT 或者 PROPFIND。
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 xml:id="wrappers.php.output">
|
||||
@@ -231,9 +221,9 @@
|
||||
</row>
|
||||
<row>
|
||||
<entry>支持 <function>stat</function></entry>
|
||||
<entry>仅
|
||||
<literal>php://memory</literal> 和
|
||||
<literal>php://temp</literal>。
|
||||
<entry>
|
||||
不支持。不过,<literal>php://memory</literal> 和
|
||||
<literal>php://temp</literal> 支持 <function>fstat</function>。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@@ -268,42 +258,6 @@
|
||||
</para>
|
||||
</refsect1> <!-- }}} -->
|
||||
|
||||
<refsect1 role="changelog"><!-- {{{ -->
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.6.0</entry>
|
||||
<entry>
|
||||
<filename>php://input</filename> 可反复使用。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.3.6</entry>
|
||||
<entry>
|
||||
增加 <filename>php://fd</filename>。
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.1.0</entry>
|
||||
<entry>
|
||||
增加 <filename>php://memory</filename> 和 <filename>php://temp</filename>。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="examples"><!-- {{{ -->
|
||||
&reftitle.examples;
|
||||
<example><!-- {{{ -->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="bc.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -17,7 +17,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="bc.configuration.list">
|
||||
<row>
|
||||
<entry> <link linkend="ini.bcmath.scale">bcmath.scale</link></entry>
|
||||
<entry>"0"</entry>
|
||||
@@ -37,7 +37,7 @@
|
||||
<varlistentry xml:id="ini.bcmath.scale">
|
||||
<term>
|
||||
<parameter>bcmath.scale</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<!-- CREDITS: dallas -->
|
||||
<section xml:id="com.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
@@ -18,42 +18,48 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="com.configuration.list">
|
||||
<row>
|
||||
<entry> <link linkend="ini.com.allow-dcom">com.allow_dcom</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>自 PHP 4.0.5 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.com.autoregister-typelib">com.autoregister_typelib</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>在 PHP 4 中是 PHP_INI_SYSTEM。自 PHP 4.1.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.com.autoregister-verbose">com.autoregister_verbose</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>在 PHP 4 中是 PHP_INI_SYSTEM。自 PHP 4.1.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.com.autoregister-casesensitive">com.autoregister_casesensitive</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>在 PHP 4 中是 PHP_INI_SYSTEM。自 PHP 4.1.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.com.code-page">com.code_page</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 5.0.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.com.dotnet-version">com.dotnet_version</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>As of PHP 8.0.0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.com.typelib-file">com.typelib_file</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>自 PHP 4.0.5 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -84,7 +90,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
When this is turned on, PHP will attempt to register constants from
|
||||
the typelibrary of objects that it instantiates, if those objects
|
||||
the typelibrary of <classname>COM</classname> objects that it instantiates, if those objects
|
||||
implement the interfaces required to obtain that information.
|
||||
The case sensitivity of the constants it registers is controlled by the
|
||||
<xref
|
||||
@@ -114,7 +120,7 @@
|
||||
<listitem>
|
||||
<para>
|
||||
When this is turned on (the default), constants found in auto-loaded
|
||||
type libraries will be registered case sensitively. See
|
||||
type libraries when instatiating <classname>COM</classname> objects will be registered case sensitively. See
|
||||
<function>com_load_typelib</function> for more details.
|
||||
</para>
|
||||
</listitem>
|
||||
@@ -140,11 +146,19 @@
|
||||
script becomes less portable; you should use the COM constructor parameter
|
||||
whenever possible.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
This configuration directive was introduced with PHP 5.
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="ini.com.dotnet-version">
|
||||
<term>
|
||||
<parameter>com.dotnet_version</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The version of the .NET framework to use for <classname>dotnet</classname> objects.
|
||||
The value of the setting is the first three parts of the framework's version number,
|
||||
separated by dots, and prefixed with <literal>v</literal>, e.g. <literal>v4.0.30319</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: daijie Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: daijie Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<section xml:id="curl.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
@@ -18,7 +18,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="curl.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.curl.cainfo">curl.cainfo</link></entry>
|
||||
<entry>NULL</entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="datetime.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -17,36 +17,36 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="datetime.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.date.default-latitude">date.default_latitude</link></entry>
|
||||
<entry>"31.7667"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 5.0.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.date.default-longitude">date.default_longitude</link></entry>
|
||||
<entry>"35.2333"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 5.0.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.date.sunrise-zenith">date.sunrise_zenith</link></entry>
|
||||
<entry>"90.83"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 5.0.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.date.sunset-zenith">date.sunset_zenith</link></entry>
|
||||
<entry>"90.83"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 5.0.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.date.timezone">date.timezone</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 5.0.0 起可用</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="exif.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -22,42 +22,42 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="exif.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.exif.encode-unicode">exif.encode_unicode</link></entry>
|
||||
<entry>"ISO-8859-15"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.exif.decode-unicode-motorola">exif.decode_unicode_motorola</link></entry>
|
||||
<entry>"UCS-2BE"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.exif.decode-unicode-intel">exif.decode_unicode_intel</link></entry>
|
||||
<entry>"UCS-2LE"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.exif.encode-jis">exif.encode_jis</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.exif.decode-jis-motorola">exif.decode_jis_motorola</link></entry>
|
||||
<entry>"JIS"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.exif.decode-jis-intel">exif.decode_jis_intel</link></entry>
|
||||
<entry>"JIS"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起可用。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: cb2e7b70b1354e5468e538720d59c37e273bc98e Maintainer:duanxiaoqiang Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer:duanxiaoqiang Status: ready -->
|
||||
<!-- Reviewed: no Maintainer:duanxiaoqiang -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="geoip.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.geoip.custom-directory">geoip.custom_directory</link></entry>
|
||||
<entry>""</entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: b58a71d289a8257a8cefc693a0dfdbaf952a8f93 Maintainer: daijie Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: daijie Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<section xml:id="iconv.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
@@ -18,24 +18,24 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="iconv.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.iconv.input-encoding">iconv.input_encoding</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.5 起有效。在 PHP 5.6.0 中废弃。</entry>
|
||||
<entry>在 PHP 5.6.0 中废弃。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.iconv.output-encoding">iconv.output_encoding</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.5 起有效。在 PHP 5.6.0 中废弃。</entry>
|
||||
<entry>在 PHP 5.6.0 中废弃。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.iconv.internal-encoding">iconv.internal_encoding</link></entry>
|
||||
<entry>""</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.5 起有效。在 PHP 5.6.0 中废弃。</entry>
|
||||
<entry>在 PHP 5.6.0 中废弃。</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
@@ -61,7 +61,7 @@
|
||||
&warn.deprecated.feature-5-6-0;
|
||||
<para>
|
||||
PHP 5.6 及以上的用户应该留空并以
|
||||
<link linkend="ini.default-charset"><parameter>default_charset</parameter></link> 取代。
|
||||
<link linkend="ini.input-encoding">input_encoding</link> 取代。
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -74,7 +74,7 @@
|
||||
&warn.deprecated.feature-5-6-0;
|
||||
<para>
|
||||
PHP 5.6 及以上的用户应该留空并以
|
||||
<link linkend="ini.default-charset"><parameter>default_charset</parameter></link> 取代。
|
||||
<link linkend="ini.output-encoding">output_encoding</link> 取代。
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- $Author$ -->
|
||||
<!-- EN-Revision: e12ed8b6aa81a21cdb906eff8bbf805a2476b403 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<section xml:id="image.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
&extension.runtime;
|
||||
@@ -17,7 +17,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="image.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.gd.jpeg-ignore-warning">gd.jpeg_ignore_warning</link></entry>
|
||||
<entry>"1"</entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 3df65c988d3f900361308a0e493af56171103e58 Maintainer: daijie Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: daijie Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<section xml:id="mbstring.configuration" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
@@ -18,71 +18,71 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="mbstring.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.language">mbstring.language</link></entry>
|
||||
<entry>"neutral"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>
|
||||
自 PHP 4.3.0 起有效。 PHP_INI_PERDIR 位于 PHP <= 5.2.6
|
||||
PHP_INI_PERDIR 位于 PHP <= 5.2.6
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.detect-order">mbstring.detect_order</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.6 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.http-input">mbstring.http_input</link></entry>
|
||||
<entry>"pass"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.6 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.http-output">mbstring.http_output</link></entry>
|
||||
<entry>"pass"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.6 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.internal-encoding">mbstring.internal_encoding</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.6 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>mbstring.script_encoding</entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.3.0 起有效。 在 PHP 5.4.0. 中移除, 使用 <link linkend="ini.zend.script-encoding">zend.script_encoding</link> 代替。</entry>
|
||||
<entry>在 PHP 5.4.0. 中移除, 使用 <link linkend="ini.zend.script-encoding">zend.script_encoding</link> 代替。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.substitute-character">mbstring.substitute_character</link></entry>
|
||||
<entry>NULL</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 4.0.6 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.func-overload">mbstring.func_overload</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_SYSTEM</entry>
|
||||
<entry>
|
||||
PHP 4.3 到 5.2.6 是 PHP_INI_PERDIR,否则是 PHP_INI_SYSTEM。
|
||||
自 PHP 4.2.0 起有效。 PHP 7.2.0 中废弃。
|
||||
PHP <= 5.2.6 是 PHP_INI_PERDIR。
|
||||
Deprecated as of PHP 7.2.0; removed as of PHP 8.0.0.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.encoding-translation">mbstring.encoding_translation</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 4.3.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.http-output-conv-mimetypes">mbstring.http_output_conv_mimetypes</link></entry>
|
||||
<entry>"^(text/|application/xhtml\+xml)"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>Available since PHP 5.3.0.</entry>
|
||||
<entry>Available as of PHP 5.3.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.mbstring.strict-detection">mbstring.strict_detection</link></entry>
|
||||
@@ -116,7 +116,7 @@
|
||||
<varlistentry xml:id="ini.mbstring.encoding-translation">
|
||||
<term>
|
||||
<parameter>mbstring.encoding_translation</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -205,7 +205,7 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
&warn.deprecated.feature-7-2-0;
|
||||
&warn.deprecated.feature-7-2-0.removed-8-0-0;
|
||||
<para>
|
||||
用 mbstring 对应的函数覆盖单字节版本的函数集。更多信息参见<link linkend="mbstring.overload">函数的覆盖</link>。
|
||||
</para>
|
||||
@@ -227,7 +227,7 @@
|
||||
<varlistentry xml:id="ini.mbstring.strict-detection">
|
||||
<term>
|
||||
<parameter>mbstring.strict_detection</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<section xml:id="mcrypt.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
@@ -18,7 +18,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="mcrypt.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.mcrypt.algorithms-dir">mcrypt.algorithms_dir</link></entry>
|
||||
<entry>&null;</entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="memcache.ini" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -17,7 +17,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="memcache.ini.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.memcache.allow-failover">memcache.allow_failover</link></entry>
|
||||
<entry>"1"</entry>
|
||||
@@ -110,7 +110,7 @@
|
||||
<varlistentry xml:id="ini.memcache.allow-failover">
|
||||
<term>
|
||||
<parameter>memcache.allow_failover</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -122,7 +122,7 @@
|
||||
<varlistentry xml:id="ini.memcache.max-failover-attempts">
|
||||
<term>
|
||||
<parameter>memcache.max_failover_attempts</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -135,7 +135,7 @@
|
||||
<varlistentry xml:id="ini.memcache.chunk-size">
|
||||
<term>
|
||||
<parameter>memcache.chunk_size</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -228,7 +228,7 @@
|
||||
<varlistentry xml:id="ini.memcache.redundancy">
|
||||
<term>
|
||||
<parameter>memcache.redundancy</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -240,7 +240,7 @@
|
||||
<varlistentry xml:id="ini.memcache.session-redundancy">
|
||||
<term>
|
||||
<parameter>memcache.session_redundancy</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -252,7 +252,7 @@
|
||||
<varlistentry xml:id="ini.memcache.compress-threshold">
|
||||
<term>
|
||||
<parameter>memcache.compress_threshold</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -264,7 +264,7 @@
|
||||
<varlistentry xml:id="ini.memcache.lock-timeout">
|
||||
<term>
|
||||
<parameter>memcache.lock_timeout</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: c0024126d1a5ed05d9e3ff83e5cbff3d8cb5e259 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="pcre.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -17,7 +17,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="pcre.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.pcre.backtrack-limit">pcre.backtrack_limit</link></entry>
|
||||
<entry>"100000"</entry>
|
||||
@@ -49,7 +49,7 @@
|
||||
<varlistentry xml:id="ini.pcre.backtrack-limit">
|
||||
<term>
|
||||
<parameter>pcre.backtrack_limit</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -60,7 +60,7 @@
|
||||
<varlistentry xml:id="ini.pcre.recursion-limit">
|
||||
<term>
|
||||
<parameter>pcre.recursion_limit</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -72,7 +72,7 @@
|
||||
<varlistentry xml:id="ini.pcre.jit">
|
||||
<term>
|
||||
<parameter>pcre.jit</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: ichenshy Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: ichenshy Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<section xml:id="pdo.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
@@ -18,7 +18,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="pdo.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.pdo.dsn">pdo.dsn.*</link></entry>
|
||||
<entry></entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="pgsql.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -17,7 +17,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="pgsql.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.pgsql.allow-persistent">pgsql.allow_persistent</link></entry>
|
||||
<entry>"1"</entry>
|
||||
@@ -66,7 +66,7 @@
|
||||
<varlistentry xml:id="ini.pgsql.allow-persistent">
|
||||
<term>
|
||||
<parameter>pgsql.allow_persistent</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -78,7 +78,7 @@
|
||||
<varlistentry xml:id="ini.pgsql.max-persistent">
|
||||
<term>
|
||||
<parameter>pgsql.max_persistent</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -90,7 +90,7 @@
|
||||
<varlistentry xml:id="ini.pgsql.max-links">
|
||||
<term>
|
||||
<parameter>pgsql.max_links</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -101,7 +101,7 @@
|
||||
<varlistentry xml:id="ini.pgsql.auto-reset-persistent">
|
||||
<term>
|
||||
<parameter>pgsql.auto_reset_persistent</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -113,7 +113,7 @@
|
||||
<varlistentry xml:id="ini.pgsql.ignore-notice">
|
||||
<term>
|
||||
<parameter>pgsql.ignore_notice</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -125,7 +125,7 @@
|
||||
<varlistentry xml:id="ini.pgsql.log-notice">
|
||||
<term>
|
||||
<parameter>pgsql.log_notice</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: f052ac1bd73549125c3fc3dc68a36d4b0608a16d Maintainer: Szopen Xiao Status: ready -->
|
||||
<!-- EN-Revision: 6dfe0767250cdbdf509223f6bc266557b0a3fec9 Maintainer: Szopen Xiao Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<section xml:id="readline.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
@@ -18,7 +18,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="readline.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.cli.pager">cli.pager</link></entry>
|
||||
<entry>""</entry>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: d4929a36edfa69000356bd315ebf60f5adc2bf40 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- EN-Revision: 3e08a8aae657492bdcdc7c550099ddf072042fa9 Maintainer: HonestQiao Status: ready -->
|
||||
<!-- Reviewed: no Maintainer: HonestQiao -->
|
||||
<section xml:id="session.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
@@ -17,7 +17,7 @@
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody xml:id="session.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.session.save-path">session.save_path</link></entry>
|
||||
<entry>""</entry>
|
||||
@@ -172,49 +172,43 @@
|
||||
<entry><link linkend="ini.session.upload-progress.enabled">session.upload_progress.enabled</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 5.4.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.upload-progress.cleanup">session.upload_progress.cleanup</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 5.4.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.upload-progress.prefix">session.upload_progress.prefix</link></entry>
|
||||
<entry>"upload_progress_"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 5.4.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.upload-progress.name">session.upload_progress.name</link></entry>
|
||||
<entry>"PHP_SESSION_UPLOAD_PROGRESS"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 5.4.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.upload-progress.freq">session.upload_progress.freq</link></entry>
|
||||
<entry>"1%"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 5.4.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.upload-progress.min-freq">session.upload_progress.min_freq</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_PERDIR</entry>
|
||||
<entry>自 PHP 5.4.0 起有效。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.lazy-write">session.lazy_write</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 7.0.0 起有效。</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.url-rewriter.tags">url_rewriter.tags</link></entry>
|
||||
<entry>"a=href,area=href,frame=src,form="</entry>
|
||||
<entry>PHP_INI_ALL</entry>
|
||||
<entry>自 PHP 7.1.0 起,session 功能不再使用此选项。</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.session.hash-function">session.hash_function</link></entry>
|
||||
@@ -329,7 +323,7 @@
|
||||
<varlistentry xml:id="ini.session.auto-start">
|
||||
<term>
|
||||
<parameter>session.auto_start</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -371,7 +365,7 @@
|
||||
<varlistentry xml:id="ini.session.gc-probability">
|
||||
<term>
|
||||
<parameter>session.gc_probability</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -519,7 +513,7 @@
|
||||
<varlistentry xml:id="ini.session.use-cookies">
|
||||
<term>
|
||||
<parameter>session.use_cookies</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -532,7 +526,7 @@
|
||||
<varlistentry xml:id="ini.session.use-only-cookies">
|
||||
<term>
|
||||
<parameter>session.use_only_cookies</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -547,7 +541,7 @@
|
||||
<varlistentry xml:id="ini.session.cookie-lifetime">
|
||||
<term>
|
||||
<parameter>session.cookie_lifetime</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -842,7 +836,7 @@
|
||||
<varlistentry xml:id="ini.session.hash-bits-per-character">
|
||||
<term>
|
||||
<parameter>session.hash_bits_per_character</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -947,7 +941,7 @@
|
||||
<varlistentry xml:id="ini.session.upload-progress.min-freq">
|
||||
<term>
|
||||
<parameter>session.upload_progress.min_freq</parameter>
|
||||
<type>integer</type>
|
||||
<type>int</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -960,7 +954,7 @@
|
||||
<varlistentry xml:id="ini.session.lazy-write">
|
||||
<term>
|
||||
<parameter>session.lazy_write</parameter>
|
||||
<type>boolean</type>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
@@ -973,11 +967,6 @@
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para><link
|
||||
linkend="ini.register-globals"><literal>register_globals</literal></link>
|
||||
配置选项影响到会话变量是怎样存储和恢复的。
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Upload progress will not be registered unless
|
||||
session.upload_progress.enabled is enabled, and the
|
||||
|
||||
Reference in New Issue
Block a user