<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/info.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'info.configuration.php',
    1 => '运行时配置',
    2 => '运行时配置',
  ),
  'up' => 
  array (
    0 => 'info.setup.php',
    1 => '安装/配置',
  ),
  'prev' => 
  array (
    0 => 'info.setup.php',
    1 => '安装/配置',
  ),
  'next' => 
  array (
    0 => 'info.constants.php',
    1 => '预定义常量',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/info/ini.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="info.configuration" class="section">
 <h2 class="title">运行时配置</h2>
 <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>PHP 选项 / Info 配置选项</strong></caption>
   
    <thead>
     <tr>
      <th>名字</th>
      <th>默认</th>
      <th>可修改范围</th>
      <th>更新日志</th>
     </tr>

    </thead>

    <tbody class="tbody">
    <tr>
     <td><a href="info.configuration.php#ini.assert.active" class="link">assert.active</a></td>
     <td>&quot;1&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td>
      自 PHP 8.3.0 起弃用
     </td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.assert.bail" class="link">assert.bail</a></td>
     <td>&quot;0&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td>
      自 PHP 8.3.0 起弃用
     </td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.assert.warning" class="link">assert.warning</a></td>
     <td>&quot;1&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td>
      自 PHP 8.3.0 起弃用
     </td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.assert.callback" class="link">assert.callback</a></td>
     <td>NULL</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td>
      自 PHP 8.3.0 起弃用
     </td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.assert.quiet-eval" class="link">assert.quiet_eval</a></td>
     <td>&quot;0&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td>从 PHP 8.0.0 移除</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.assert.exception" class="link">assert.exception</a></td>
     <td>&quot;1&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td>在 PHP 8.0.0 之前，默认是 <code class="literal">&quot;0&quot;</code>，自 PHP 8.3.0 起弃用</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.enable-dl" class="link">enable_dl</a></td>
     <td>&quot;1&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong></td>
     <td>本过时特性<em>将</em>肯定会在未来被<em>移除</em>。</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.max-execution-time" class="link">max_execution_time</a></td>
     <td>&quot;30&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.max-input-time" class="link">max_input_time</a></td>
     <td>&quot;-1&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.max-input-nesting-level" class="link">max_input_nesting_level</a></td>
     <td>&quot;64&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.max-input-vars" class="link">max_input_vars</a></td>
     <td>1000</td>
     <td><strong><code><a href="info.constants.php#constant.ini-perdir">INI_PERDIR</a></code></strong></td>
     <td class="empty">&nbsp;</td>
    </tr>

    <tr>
     <td><a href="info.configuration.php#ini.zend.enable-gc" class="link">zend.enable_gc</a></td>
     <td>&quot;1&quot;</td>
     <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
     <td class="empty">&nbsp;</td>
    </tr>

     <tr>
      <td><a href="info.configuration.php#ini.zend.max-allowed-stack-size" class="link">zend.max_allowed_stack_size</a></td>
      <td>&quot;0&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong></td>
      <td>自 PHP 8.3.0 起可用。</td>
     </tr>

     <tr>
      <td><a href="info.configuration.php#ini.zend.reserved-stack-size" class="link">zend.reserved_stack_size</a></td>
      <td>&quot;0&quot;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-system">INI_SYSTEM</a></code></strong></td>
      <td>自 PHP 8.3.0 起可用。</td>
     </tr>

     <tr>
      <td><a href="info.configuration.php#ini.fiber.stack-size" class="link">fiber.stack_size</a></td>
      <td class="empty">&nbsp;</td>
      <td><strong><code><a href="info.constants.php#constant.ini-all">INI_ALL</a></code></strong></td>
      <td>自 PHP 8.1.0 起可用。</td>
     </tr>

    </tbody>
   
  </table>

  有关 INI_* 样式的更多详情与定义，见 <a href="configuration.changes.modes.php" class="xref">配置可被设定范围</a>。
 </p>
 
 <p class="para">这是配置指令的简短说明。</p>
 
 <p class="para">
  <dl>
   
    <dt id="ini.assert.active">
     <code class="parameter">assert.active</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      激活 <span class="function"><a href="function.assert.php" class="function">assert()</a></span> 断言评测。应该使用 <a href="ini.core.php#ini.zend.assertions" class="link">zend.assertions</a> 来控制 <span class="function"><a href="function.assert.php" class="function">assert()</a></span> 的行为。
     </p>
     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自 PHP 8.3.0
起<em>废弃</em>。强烈建议不要使用本特性。</p></div>
    </dd>
   

   
    <dt id="ini.assert.bail">
     <code class="parameter">assert.bail</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      失败的断言将中止脚本。
     </p>
     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自 PHP 8.3.0
起<em>废弃</em>。强烈建议不要使用本特性。</p></div>
    </dd>
   

   
    <dt id="ini.assert.warning">
     <code class="parameter">assert.warning</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      为每个失败的断言产生一条 PHP 警告信息。
     </p>
     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自 PHP 8.3.0
起<em>废弃</em>。强烈建议不要使用本特性。</p></div>
    </dd>
   

   
    <dt id="ini.assert.callback">
     <code class="parameter">assert.callback</code>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
    </dt>
    <dd>
     <p class="para">
      断言失败后要调用的回调函数。
     </p>
     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自 PHP 8.3.0
起<em>废弃</em>。强烈建议不要使用本特性。</p></div>
    </dd>
   

   
    <dt id="ini.assert.quiet-eval">
     <code class="parameter">assert.quiet_eval</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <div class="warning"><strong class="warning">警告</strong>
<p class="simpara">此功能自 PHP 8.0.0 起<em>移除</em>。</p>
</div>
     <p class="para">
      在断言表达式执行时 <span class="function"><a href="function.error-reporting.php" class="function">error_reporting()</a></span> 使用当前的设置。如果启用了，在执行时错误将不会被显示（隐式的 
      error_reporting(0)）。如果禁用了，错误将根据 <span class="function"><a href="function.error-reporting.php" class="function">error_reporting()</a></span> 的设置来显示。
     </p>
    </dd>
   

   
    <dt id="ini.assert.exception">
     <code class="parameter">assert.exception</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      在断言（assert）失败时产生 <span class="classname"><a href="class.assertionerror.php" class="classname">AssertionError</a></span> 异常。
     </p>
     <div class="warning"><strong class="warning">警告</strong><p class="simpara">本特性已自 PHP 8.3.0
起<em>废弃</em>。强烈建议不要使用本特性。</p></div>
    </dd>
   
   
   
    <dt id="ini.enable-dl">
      <code class="parameter">enable_dl</code>
      <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      该指令允许开启或关闭使用 <span class="function"><a href="function.dl.php" class="function">dl()</a></span> 动态加载 PHP 模块。
     </p>
     <p class="para">
      关闭动态加载的主要原因是为了安全。通过动态加载，有可能忽略所有 
      <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> 限制。默认允许动态加载。
     </p>
    </dd>
   

   
    <dt id="ini.max-execution-time">
     <code class="parameter">max_execution_time</code>
      <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      这设置了脚本被解析器中止之前允许的最大执行时间，单位秒。这有助于防止写得不好的脚本占尽服务器资源。默认设置为 
      <code class="literal">30</code>。从<a href="features.commandline.php" class="link">命令行</a>运行 PHP 
      时，默认设置为 <code class="literal">0</code>。
     </p>
     <p class="para">
      在非 Windows 系统上，最大执行时间不会影响系统调用和系统操作等。更多细节参见 <span class="function"><a href="function.set-time-limit.php" class="function">set_time_limit()</a></span>。
     </p>
     <p class="para">
      你的 web 服务器也可以有其他超时设置，也有可能中断 PHP 的执行。Apache 有一个
      <code class="literal">Timeout</code> 指令，IIS 有一个 CGI 超时功能。他们默认都是 
      300 秒。更多具体信息参见你的 web 服务器的文档。
     </p>
    </dd>
   

   
    <dt id="ini.max-input-time">
     <code class="parameter">max_input_time</code>
      <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      脚本解析输入数据（类似 POST 和 GET）允许的最大时间，单位是秒。它从接收所有数据到开始执行脚本进行测量的。默认设置为
      <code class="literal">-1</code>，意味着使用 <a href="info.configuration.php#ini.max-execution-time" class="link">max_execution_time</a>
      的值做为默认值，如果不想限制，请设置为 <code class="literal">0</code>。
     </p>
    </dd>
   

   
    <dt id="ini.max-input-nesting-level">
     <code class="parameter">max_input_nesting_level</code>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      设置 <a href="language.variables.external.php" class="link">输入变量</a> 
      的最大允许嵌套的深度。（例如 <var class="varname"><a href="reserved.variables.get.php" class="classname">$_GET</a></var>、<var class="varname"><a href="reserved.variables.post.php" class="classname">$_POST</a></var>）
     </p>
    </dd>
   

   
    <dt id="ini.max-input-vars">
     <code class="parameter">max_input_vars</code>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      接受多少 <a href="language.variables.external.php" class="link">输入的变量</a>（限制分别应用于 $_GET、$_POST 和 
      $_COOKIE 超全局变量）指令的使用减轻了以哈希碰撞来进行拒绝服务攻击的可能性。如有超过指令指定数量的输入变量，将会导致 
      <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> 的产生，更多的输入变量将会从请求中截断。
     </p>
    </dd>
   

   
    <dt id="ini.zend.enable-gc">
     <code class="parameter">zend.enable_gc</code>
     <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
    </dt>
    <dd>
     <p class="para">
      启用或禁用循环引用记数收集器。
     </p>
    </dd>
   

   
    <dt id="ini.zend.max-allowed-stack-size">
     <code class="parameter">zend.max_allowed_stack_size</code>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      程序允许消耗的操作系统原生堆栈空间的最大值。
      尝试消耗超过操作系统允许的堆栈空间通常会导致硬崩溃，没有易于获得的调试信息。
      为了使调试更容易，引擎在发生之前（当程序使用超过
      <a href="info.configuration.php#ini.zend.max-allowed-stack-size" class="link">zend.max_allowed_stack_size</a>-<a href="info.configuration.php#ini.zend.reserved-stack-size" class="link">zend.reserved_stack_size</a>
      字节的堆栈时）抛出一个
      <span class="classname"><a href="class.error.php" class="classname">Error</a></span>。
     </p>
     <p class="para">
      用户定义代码中的递归不会消耗原生堆栈空间。
      但是，内部函数和魔术方法会。
      涉及这些函数的非常深的递归可能会导致程序耗尽所有可用的原生堆栈空间。
     </p>
     <p class="para">
      可能的值为：
      <ul class="simplelist">
       <li>
        <code class="literal">0</code>：
        自动检测操作系统允许程序消耗的最大原生堆栈空间。
        这是默认值。
        当无法检测时，使用已知的系统默认值。
       </li>
       <li>
        <code class="literal">-1</code>：
        禁用引擎中的堆栈大小检查。
       </li>
       <li>
        正整数：固定大小，以字节为单位。
        设置此值过高会导致与禁用堆栈大小检查相同的效果。
       </li>
      </ul>
     </p>
     <p class="para">
      由于 <a href="language.fibers.php" class="link">Fiber</a> 的堆栈大小由
      <a href="info.configuration.php#ini.fiber.stack-size" class="link">fiber.stack_size</a> 决定，
      在执行 Fiber 时检查堆栈使用情况时，使用此参数的值而不是
      <a href="info.configuration.php#ini.zend.max-allowed-stack-size" class="link">zend.max_allowed_stack_size</a>。
     </p>
     <blockquote class="note"><p><strong class="note">注意</strong>: 
      <p class="para">
       这与堆栈 <em>缓冲区</em> 溢出无关，也不是安全功能。
      </p>
     </p></blockquote>
    </dd>
   

   
    <dt id="ini.zend.reserved-stack-size">
     <code class="parameter">zend.reserved_stack_size</code>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      保留的堆栈大小，以字节为单位。
      在检查堆栈大小时，从
      <a href="info.configuration.php#ini.zend.max-allowed-stack-size" class="link">max allowed stack size</a>
      减去此值作为缓冲区。
     </p>
     <p class="para">
      可能的值为：
      <ul class="simplelist">
       <li>
        <code class="literal">0</code>：自动检测合理大小。
       </li>
       <li>
        正整数：固定大小，以字节为单位。
       </li>
      </ul>
     </p>
    </dd>
   

   
    <dt id="ini.fiber.stack-size">
     <code class="parameter">fiber.stack_size</code>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
    </dt>
    <dd>
     <p class="para">
      为每个 <a href="language.fibers.php" class="link">Fiber</a> 分配的本地堆栈大小，以字节为单位。
     </p>
     <p class="para">
      默认值是系统指针大小小于 8 字节的系统上的 1MiB，否则为 2MiB。
     </p>
    </dd>
   
  </dl>
 </p>
</div><?php manual_footer($setup); ?>