mirror of
https://github.com/php/doc-zh.git
synced 2026-03-24 07:02:15 +01:00
1265 lines
44 KiB
XML
1265 lines
44 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
<!-- EN-Revision: 87d6bb1bbd5f118f5b0cf0160438f06c0f91ea45 Maintainer: yuanyuqiang Status: ready -->
|
||
<!-- CREDITS: mowangjuanzi, Luffy -->
|
||
<sect1 xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="opcache.configuration">
|
||
&reftitle.runtime;
|
||
&extension.runtime;
|
||
<para>
|
||
<table>
|
||
<title>OPcache 配置选项</title>
|
||
<tgroup cols="4">
|
||
<thead>
|
||
<row>
|
||
<entry>&Name;</entry>
|
||
<entry>&Default;</entry>
|
||
<entry>&Changeable;</entry>
|
||
<entry>&Changelog;</entry>
|
||
</row>
|
||
</thead>
|
||
<tbody xml:id="opcache.configuration.list">
|
||
<row>
|
||
<entry><link linkend="ini.opcache.enable">opcache.enable</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.enable-cli">opcache.enable_cli</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>在 PHP 7.1.2 至 7.1.6(含)的版本,默认值是 <literal>1</literal></entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.memory-consumption">opcache.memory_consumption</link></entry>
|
||
<entry>128</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.interned-strings-buffer">opcache.interned_strings_buffer</link></entry>
|
||
<entry>8</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.max-accelerated-files">opcache.max_accelerated_files</link></entry>
|
||
<entry>10000</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.max-wasted-percentage">opcache.max_wasted_percentage</link></entry>
|
||
<entry>5</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.use-cwd">opcache.use_cwd</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.revalidate-freq">opcache.revalidate_freq</link></entry>
|
||
<entry>2</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.revalidate-path">opcache.revalidate_path</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.save-comments">opcache.save_comments</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.fast-shutdown">opcache.fast_shutdown</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>从 PHP 7.2.0 开始被移除</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.enable-file-override">opcache.enable_file_override</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.optimization-level">opcache.optimization_level</link></entry>
|
||
<entry>0x7FFEBFFF</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>从 PHP 7.3.0 起修改为 <literal>0x7FFFBFFF</literal></entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.inherited-hack">opcache.inherited_hack</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 7.3.0 被移除</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.dups-fix">opcache.dups_fix</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.blacklist-filename">opcache.blacklist_filename</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.max-file-size">opcache.max_file_size</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.consistency-checks">opcache.consistency_checks</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 8.1.18 和 8.2.5 起禁用。从 PHP 8.3.0 起已删除。</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.force-restart-timeout">opcache.force_restart_timeout</link></entry>
|
||
<entry>180</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.error-log">opcache.error_log</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.log-verbosity-level">opcache.log_verbosity_level</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.record-warnings">opcache.record_warnings</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.preferred-memory-model">opcache.preferred_memory_model</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.protect-memory">opcache.protect_memory</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.mmap-base">opcache.mmap_base</link></entry>
|
||
<entry>&null;</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>仅限 Windows。</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.restrict-api">opcache.restrict_api</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.file_update_protection">opcache.file_update_protection</link></entry>
|
||
<entry>2</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.huge_code_pages">opcache.huge_code_pages</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.lockfile_path">opcache.lockfile_path</link></entry>
|
||
<entry>"/tmp"</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.opt_debug_level">opcache.opt_debug_level</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 7.1.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.file-cache">opcache.file_cache</link></entry>
|
||
<entry>&null;</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.file-cache-only">opcache.file_cache_only</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.file-cache-consistency-checks">opcache.file_cache_consistency_checks</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry/>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.file-cache-fallback">opcache.file_cache_fallback</link></entry>
|
||
<entry>1</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>仅适用于 Windows 平台</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.validate-permission">opcache.validate_permission</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>从 PHP 7.0.14 开始支持</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.validate-root">opcache.validate_root</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>从 PHP 7.0.14 开始支持</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.preload">opcache.preload</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>从 PHP 7.4.0 开始支持</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.preload-user">opcache.preload_user</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>从 PHP 7.4.0 开始支持</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.cache-id">opcache.cache_id</link></entry>
|
||
<entry>""</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>仅支持 Windows。自 PHP 7.4.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit">opcache.jit</link></entry>
|
||
<entry>"disable"</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效,PHP 8.4.0 之前,默认值为“tracing”。</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-buffer-size">opcache.jit_buffer_size</link></entry>
|
||
<entry>64M</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效,PHP 8.4.0 之前,默认值为 0。</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-debug">opcache.jit_debug</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-bisect-limit">opcache.jit_bisect_limit</link></entry>
|
||
<entry>0</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-prof-threshold">opcache.jit_prof_threshold</link></entry>
|
||
<entry>0.005</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-root-traces">opcache.jit_max_root_traces</link></entry>
|
||
<entry>1024</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-side-traces">opcache.jit_max_side_traces</link></entry>
|
||
<entry>128</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-exit-counters">opcache.jit_max_exit_counters</link></entry>
|
||
<entry>8192</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-hot-loop">opcache.jit_hot_loop</link></entry>
|
||
<entry>64</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-hot-func">opcache.jit_hot_func</link></entry>
|
||
<entry>127</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-hot-return">opcache.jit_hot_return</link></entry>
|
||
<entry>8</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-hot-side-exit">opcache.jit_hot_side_exit</link></entry>
|
||
<entry>8</entry>
|
||
<entry><constant>INI_SYSTEM</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-blacklist-root-trace">opcache.jit_blacklist_root_trace</link></entry>
|
||
<entry>16</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-blacklist-side-trace">opcache.jit_blacklist_side_trace</link></entry>
|
||
<entry>8</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-loop-unrolls">opcache.jit_max_loop_unrolls</link></entry>
|
||
<entry>8</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-recursive-calls">opcache.jit_max_recursive_calls</link></entry>
|
||
<entry>2</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-recursive-return">opcache.jit_max_recursive_returns</link></entry>
|
||
<entry>2</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
<row>
|
||
<entry><link linkend="ini.opcache.jit-max-polymorphic-calls">opcache.jit_max_polymorphic_calls</link></entry>
|
||
<entry>2</entry>
|
||
<entry><constant>INI_ALL</constant></entry>
|
||
<entry>自 PHP 8.0.0 起有效</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</table>
|
||
&ini.php.constants;
|
||
</para>
|
||
|
||
&ini.descriptions.title;
|
||
|
||
<variablelist>
|
||
<varlistentry xml:id="ini.opcache.enable">
|
||
<term>
|
||
<parameter>opcache.enable</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
启用操作码缓存。如果禁用此选项,则不会优化和缓存代码。
|
||
在运行期使用 <function>ini_set</function> 函数只能禁用
|
||
<literal>opcache.enable</literal> 设置,不可以启用此设置。
|
||
如果在脚本中尝试启用此设置项会产生警告。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.enable-cli">
|
||
<term>
|
||
<parameter>opcache.enable_cli</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
仅针对 CLI 版本的 PHP 启用操作码缓存。
|
||
通常被用来测试和调试。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.memory-consumption">
|
||
<term>
|
||
<parameter>opcache.memory_consumption</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
OPcache 的共享内存大小,以兆字节为单位。最小允许值为
|
||
<literal>"8"</literal>。如果设置的值小于最小值,则强制设置为允许的最小值。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.interned-strings-buffer">
|
||
<term>
|
||
<parameter>opcache.interned_strings_buffer</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
用来存储预留字符串的内存大小,以 MB 为单位。最大值在 64 位架构上为 32767,在 32 位架构上为 4095。
|
||
</simpara>
|
||
<note>
|
||
<simpara>
|
||
PHP 8.4.0 之前,所有架构上的最大值都是 4095 MB。
|
||
</simpara>
|
||
</note>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.max-accelerated-files">
|
||
<term>
|
||
<parameter>opcache.max_accelerated_files</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
OPcache 哈希表中可存储的脚本文件数量上限。真实的取值是在质数集合<literal>{
|
||
223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793
|
||
}</literal> 中找到的第一个大于等于设置值的质数。设置值取值范围最小值是
|
||
200,最大值是 1000000。超出范围的值将限制为允许的值。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.max-wasted-percentage">
|
||
<term>
|
||
<parameter>opcache.max_wasted_percentage</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果可用内存不足,在计划重新启动之前,允许浪费的最大内存百分比。最大允许值是
|
||
<literal>"50"</literal>,如果设置了更大的值,则强制设置为允许的最大值。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.use-cwd">
|
||
<term>
|
||
<parameter>opcache.use_cwd</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果启用,OPcache 将在哈希表的脚本键之后附加改脚本的工作目录,
|
||
以避免同名脚本冲突的问题。
|
||
禁用此选项可以提高性能,但是可能会导致应用崩溃。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.validate-timestamps">
|
||
<term>
|
||
<parameter>opcache.validate_timestamps</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<para>
|
||
如果启用,那么 OPcache 会每隔 <link linkend="ini.opcache.revalidate-freq">opcache.revalidate_freq</link> 设定的秒数
|
||
检查脚本是否更新。
|
||
如果禁用此选项,你必须使用 <function>opcache_reset</function> 或者
|
||
<function>opcache_invalidate</function> 函数来手动重置 OPcache,也可以
|
||
通过重启 Web 服务器来使文件系统更改生效。
|
||
<note>
|
||
<simpara>
|
||
如果将 <link linkend="ini.opcache.file_update_protection">opcache.file_update_protection</link> 或
|
||
<link linkend="ini.opcache.max-file-size">opcache.max_file_size</link> 选项设置为非零值,OPcache
|
||
仍可能在编译时验证文件的时间戳。
|
||
</simpara>
|
||
</note>
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.revalidate-freq">
|
||
<term>
|
||
<parameter>opcache.revalidate_freq</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
检查脚本时间戳是否有更新的周期,以秒为单位。
|
||
设置为 <literal>0</literal> 会导致针对每个请求, OPcache 都会检查脚本更新。
|
||
</simpara>
|
||
<simpara>
|
||
如果
|
||
<link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link>
|
||
配置指令设置为禁用,那么此设置项将会被忽略。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.revalidate-path">
|
||
<term>
|
||
<parameter>opcache.revalidate_path</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果禁用此选项,在同一个 <link linkend="ini.include-path">include_path</link>
|
||
已存在的缓存文件会被重用。
|
||
因此,将无法找到不在包含路径下的同名文件。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.save-comments">
|
||
<term>
|
||
<parameter>opcache.save_comments</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果禁用,脚本文件中的注释内容将不会被包含到操作码缓存文件,
|
||
这样可以有效减小优化后的文件体积。
|
||
禁用此配置指令可能会导致一些依赖注释或注解的
|
||
应用或框架无法正常工作,
|
||
比如: Doctrine, Zend Framework 2 以及 PHPUnit。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.fast-shutdown">
|
||
<term>
|
||
<parameter>opcache.fast_shutdown</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果启用,则会使用快速停止续发事件。
|
||
所谓快速停止续发事件是指依赖 Zend 引擎的内存管理模块
|
||
一次释放全部请求变量的内存,而不是依次释放每一个已分配的内存块。
|
||
</simpara>
|
||
<simpara>
|
||
从 PHP 7.2.0 开始,此配置指令被移除。
|
||
快速停止的续发事件的处理已经集成到 PHP 中,
|
||
只要有可能,PHP 会自动处理这些续发事件。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.enable-file-override">
|
||
<term>
|
||
<parameter>opcache.enable_file_override</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果启用,则在调用函数 <function>file_exists</function>,
|
||
<function>is_file</function> 以及 <function>is_readable</function> 的时候,
|
||
都会检查操作码缓存,无论文件是否已经被缓存。
|
||
如果应用中包含检查 PHP 脚本存在性和可读性的功能,这样可以提升性能。
|
||
但是如果禁用了 <link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link> 选项,
|
||
可能存在返回过时数据的风险。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.optimization-level">
|
||
<term>
|
||
<parameter>opcache.optimization_level</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
控制执行哪些优化的二进制位掩码。默认是应用所有安全优化。更改默认值对于调试/开发优化器非常有用(参见
|
||
<link linkend="ini.opcache.opt_debug_level">opcache.opt_debug_level</link>)。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.inherited-hack">
|
||
<term>
|
||
<parameter>opcache.inherited_hack</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
该配置指令已被忽略。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.dups-fix">
|
||
<term>
|
||
<parameter>opcache.dups_fix</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
仅作为针对 “不可重定义类”错误的一种解决方案。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.blacklist-filename">
|
||
<term>
|
||
<parameter>opcache.blacklist_filename</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
OPcache 黑名单文件位置。
|
||
黑名单文件为文本文件,包含了不进行预编译优化的文件名,每行一个文件名。
|
||
黑名单中的文件名可以使用通配符,也可以使用前缀。
|
||
此文件中以分号(;)开头的行将被视为注释。
|
||
</simpara>
|
||
<simpara>
|
||
简单的黑名单文件可能如下所示:
|
||
</simpara>
|
||
<informalexample>
|
||
<programlisting>
|
||
<![CDATA[
|
||
; 将特定文件加入到黑名单
|
||
/var/www/broken.php
|
||
; 以字符 x 文件打头的文件
|
||
/var/www/x
|
||
; 通配符匹配
|
||
/var/www/*-broken.php
|
||
]]>
|
||
</programlisting>
|
||
</informalexample>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.max-file-size">
|
||
<term>
|
||
<parameter>opcache.max_file_size</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
以字节为单位的缓存的文件大小上限。设置为
|
||
<literal>0</literal> 表示缓存全部文件。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.consistency-checks">
|
||
<term>
|
||
<parameter>opcache.consistency_checks</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果是非 0 值,OPcache 将会每隔 N 次请求检查缓存校验和。
|
||
N 即为此配置指令的设置值。
|
||
由于此选项对于性能有较大影响,请尽在调试环境使用。
|
||
</simpara>
|
||
<note>
|
||
<simpara>
|
||
自 8.1.18 和 8.2.5 起禁用。从 PHP 8.3.0 起已删除。
|
||
</simpara>
|
||
</note>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.force-restart-timeout">
|
||
<term>
|
||
<parameter>opcache.force_restart_timeout</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果缓存处于非激活状态,等待多少秒之后计划重启。
|
||
如果超出了设定时间,则 OPcache 模块将杀除持有缓存锁的进程,
|
||
并进行重启。
|
||
</simpara>
|
||
<simpara>
|
||
如果选项
|
||
<link linkend="ini.opcache.log-verbosity-level">opcache.log_verbosity_level</link>
|
||
设置为 2 或者 2 以上的数值,当发生重启时将在日志中记录一条警告信息。
|
||
</simpara>
|
||
<simpara>
|
||
Windows 不支持该指令。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.error-log">
|
||
<term>
|
||
<parameter>opcache.error_log</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
OPcache 模块的错误日志文件。
|
||
如果留空,则视为 <literal>stderr</literal>,
|
||
错误日志将被送往标准错误输出 (通常情况下是 Web 服务器的错误日志文件)。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.log-verbosity-level">
|
||
<term>
|
||
<parameter>opcache.log_verbosity_level</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
OPcache 模块的日志级别。
|
||
默认情况下,仅有致命级别(0)及错误级别(1)的日志会被记录。
|
||
其他可用的级别有:警告(2),信息(3)和调试(4)。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.record-warnings">
|
||
<term>
|
||
<parameter>opcache.record_warnings</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果启用,OPcache 将记录编译时警告并在下次对其重播,即使是从缓存中提供的。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.preferred-memory-model">
|
||
<term>
|
||
<parameter>opcache.preferred_memory_model</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
OPcache 首选的内存模块。
|
||
如果留空,OPcache 会选择适用的模块,
|
||
通常情况下,自动选择就可以满足需求。
|
||
</simpara>
|
||
<simpara>
|
||
可选值包括: <literal>mmap</literal>,<literal>shm</literal>,
|
||
<literal>posix</literal> 以及 <literal>win32</literal>。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.protect-memory">
|
||
<term>
|
||
<parameter>opcache.protect_memory</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
保护共享内存,以避免执行脚本时发生非预期的写入。
|
||
仅用于内部调试。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.mmap-base">
|
||
<term>
|
||
<parameter>opcache.mmap_base</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
在 Windows 平台上共享内存段的基地址。
|
||
所有的 PHP 进程都将共享内存映射到同样的地址空间。
|
||
使用此配置指令避免“无法重新附加到基地址”的错误。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.restrict-api">
|
||
<term>
|
||
<parameter>opcache.restrict_api</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
仅允许路径是以指定字符串开始的 PHP 脚本调用 OPcache API 函数。
|
||
默认值为空字符串 <literal>""</literal>,表示不做限制。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.file_update_protection">
|
||
<term>
|
||
<parameter>opcache.file_update_protection</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
如果文件的最后修改时间距现在不足此项配置指令所设定的秒数,那么这个文件不会进入到缓存中。
|
||
这是为了防止尚未完全修改完毕的文件进入到缓存。如果所有文件更新都是原子的,则可以通过将其设置为
|
||
<literal>0</literal> 来提高性能。这将允许文件立即缓存。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.huge_code_pages">
|
||
<term>
|
||
<parameter>opcache.huge_code_pages</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
启用或者禁用将 PHP 代码(文本段)拷贝到 HUGE PAGES 中。这应该会提高性能,但是需要适当的
|
||
OS 配置。自 PHP 7.0.0 起可在 Linux 上使用,自 PHP 7.4.0 上可在 FreeBSD 上使用。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.lockfile_path">
|
||
<term>
|
||
<parameter>opcache.lockfile_path</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
用来存储共享锁文件的绝对路径(仅适用于 *nix 操作系统)。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.opt_debug_level">
|
||
<term>
|
||
<parameter>opcache.opt_debug_level</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
出于对不同阶段的优化情况进行调试的目的,生成操作码转储。
|
||
设置为 0x10000 会在进行优化之前输出编译器编译后的操作码,
|
||
设置为 0x20000 会输出优化后的操作码。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.file-cache">
|
||
<term>
|
||
<parameter>opcache.file_cache</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
配置二级缓存目录并启用二级缓存。
|
||
启用二级缓存可以在 SHM 内存满了、服务器重启或者重置 SHM 的时候提高性能。
|
||
默认值为空字符串 <literal>""</literal>,表示禁用基于文件的缓存。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.file-cache-only">
|
||
<term>
|
||
<parameter>opcache.file_cache_only</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
启用或禁用在共享内存中的 opcode 缓存。
|
||
</simpara>
|
||
<note>
|
||
<simpara>
|
||
在 PHP 8.1.0 之前,已经存在文件缓存时禁用此指令需要手动清除文件缓存。
|
||
</simpara>
|
||
</note>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.file-cache-consistency-checks">
|
||
<term>
|
||
<parameter>opcache.file_cache_consistency_checks</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
当从文件缓存中加载脚本的时候,是否对文件的校验和进行验证。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.file-cache-fallback">
|
||
<term>
|
||
<parameter>opcache.file_cache_fallback</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
在 Windows 平台上,当一个进程无法附加到共享内存的时候,
|
||
使用基于文件的缓存,也即:<code>opcache.file_cache_only=1</code>。
|
||
需要显示的启用文件缓存。
|
||
</simpara>
|
||
<caution>
|
||
<simpara>
|
||
不鼓励禁用此配置项,
|
||
禁用它可能会导致进程无法启动。
|
||
</simpara>
|
||
</caution>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.validate-permission">
|
||
<term>
|
||
<parameter>opcache.validate_permission</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
针对当前用户,验证缓存文件的访问权限。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.validate-root">
|
||
<term>
|
||
<parameter>opcache.validate_root</parameter>
|
||
<type>bool</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
在 chroot 的环境中避免命名冲突。
|
||
为了防止进程访问到 chroot 环境之外的文件,应该在 chroot 的情况下启用这个选项。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.preload">
|
||
<term>
|
||
<parameter>opcache.preload</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
指定要在服务器启动时期进行编译和缓存的 PHP 脚本文件,
|
||
这些文件也可能通过 <function>include</function> 或者 <function>opcache_compile_file</function> 函数
|
||
来预加载其他文件。
|
||
所有这些文件中包含的实体,包括函数、类等,在服务器启动的时候就被加载和缓存,
|
||
对于用户代码来讲是“开箱可用”的。
|
||
</simpara>
|
||
<note>
|
||
<simpara>
|
||
Windows 不支持预加载。
|
||
</simpara>
|
||
</note>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.preload-user">
|
||
<term>
|
||
<parameter>opcache.preload_user</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
预加载以指定系统用户身份运行。这对于切换到非特权系统用户之前以 root
|
||
身份启动的服务器很有用。考虑到安全因素,默认禁止以 root
|
||
身份预加载代码,除非该指令明确设置为 <literal>root</literal>。自
|
||
PHP 8.3.0 起,当使用 &cli.sapi; 或 <link linkend="book.phpdbg">phpdbg
|
||
SAPI</link> 以 root 身份运行时,无需设置此指令即可允许预加载。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.cache-id">
|
||
<term>
|
||
<parameter>opcache.cache_id</parameter>
|
||
<type>string</type>
|
||
</term>
|
||
<listitem>
|
||
<para>
|
||
在 Windwos 上,运行在相同 <acronym>PHP</acronym> <acronym>SAPI</acronym> 且相同的用户账户使用相同缓存 ID
|
||
上的所有进程,会共享单个 OPcache 实例。缓存 ID 的值可以自由选择。
|
||
</para>
|
||
<tip>
|
||
<simpara>
|
||
对于 IIS,使用环境变量 <envar>APP_POOL_ID</envar> 作为
|
||
<parameter>opcache.cache_id</parameter>,可以让不同的应用池拥有自己的 OPcache 实例。
|
||
</simpara>
|
||
</tip>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit">
|
||
<term>
|
||
<parameter>opcache.jit</parameter>
|
||
<type class="union"><type>string</type><type>int</type></type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
针对经典用法,此选项接受以下四个字符串值之一:
|
||
</simpara>
|
||
<simplelist>
|
||
<member><literal>disable</literal>:完全禁用,无法在运行时启用。</member>
|
||
<member><literal>off</literal>:禁用,但可以在运行时启用。</member>
|
||
<member>
|
||
<literal>tracing</literal>/<literal>on</literal>:使用追踪 JIT。默认启用并推荐给大部分用户。
|
||
</member>
|
||
<member><literal>function</literal>:使用函数 JIT。</member>
|
||
</simplelist>
|
||
<para>
|
||
针对高级用法,此选项接受 4 位整数 <literal>CRTO</literal>,其中的位分别是:
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><literal>C</literal>(特定 CPU 优化 flag)</term>
|
||
<listitem>
|
||
<simplelist>
|
||
<member><literal>0</literal>:禁用特定 CPU 优化。</member>
|
||
<member><literal>1</literal>:如果 CPU 支持则启用 AVX。</member>
|
||
</simplelist>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><literal>R</literal>(寄存器分配)</term>
|
||
<listitem>
|
||
<simplelist>
|
||
<member><literal>0</literal>:不执行寄存器分配。</member>
|
||
<member><literal>1</literal>:执行局部域寄存器分配。</member>
|
||
<member><literal>2</literal>:执行全局寄存器分配。</member>
|
||
</simplelist>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><literal>T</literal>(触发)</term>
|
||
<listitem>
|
||
<simplelist>
|
||
<member><literal>0</literal>: 在脚本加载时编译所有函数。</member>
|
||
<member><literal>1</literal>: 在第一次执行时编译函数。</member>
|
||
<member>
|
||
<literal>2</literal>:第一次请求时分析函数,然后编译最热门函数。
|
||
</member>
|
||
<member><literal>3</literal>:动态分析和编译热门函数。</member>
|
||
<member><literal>4</literal>:目前未使用。</member>
|
||
<member>
|
||
<literal>5</literal>:使用追踪 JIT。动态分析和为热门代码段编译追踪。
|
||
</member>
|
||
</simplelist>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><literal>O</literal>(优化级别)</term>
|
||
<listitem>
|
||
<simplelist>
|
||
<member><literal>0</literal>:不 JIT。</member>
|
||
<member><literal>1</literal>:最小 JIT(调用标准 VM 处理程序)。</member>
|
||
<member><literal>2</literal>:内联 VM 处理程序。</member>
|
||
<member><literal>3</literal>:使用类型推断。</member>
|
||
<member><literal>4</literal>:使用调用图。</member>
|
||
<member><literal>5</literal>:优化整个脚本。</member>
|
||
</simplelist>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
<literal>"tracing"</literal> 模式对应 <code>CRTO = 1254</code>,<literal>"function"</literal>
|
||
模式对应 <code>CRTO = 1205</code>。
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-buffer-size">
|
||
<term>
|
||
<parameter>opcache.jit_buffer_size</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
为编译 JIT 代码保留的共享内存量。值 0 表示禁用 JIT。
|
||
</simpara>
|
||
&ini.shorthandbytes;
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-debug">
|
||
<term>
|
||
<parameter>opcache.jit_debug</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
指定位掩码,用于启动哪个 JIT 调试输出。参阅 <link xlink:href="&url.php.git.src.master.view;ext/opcache/jit/zend_jit.h">zend_jit.h</link>
|
||
(搜索以 <code>ZEND_JIT_DEBUG</code> 开头的宏定义)。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-bisect-limit">
|
||
<term>
|
||
<parameter>opcache.jit_bisect_limit</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
调试选项,在编译一定数量的函数之后禁用 JIT 编译。这对于定位 JIT 错误编译的源代码可能很有帮助。注意:此选项仅在 JIT 触发设置为
|
||
0(在脚本加载时编译)或1(第一次执行时编译)时起作用,例如 <code>opcache.jit=1215</code>。更多详细信息请参阅 <link linkend="ini.opcache.jit">opcache.jit</link> 选项。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-prof-threshold">
|
||
<term>
|
||
<parameter>opcache.jit_prof_threshold</parameter>
|
||
<type>float</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
当使用“首次请求时分析”触发模式时,此阈值确定是否视函数为热点。对该函数的调用次数除以所有函数的调用次数必须高于该阈值。例如,阈值为
|
||
0.005 表示占所有调用次数超过 0.5% 的函数将被进行 JIT 编译。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-root-traces">
|
||
<term>
|
||
<parameter>opcache.jit_max_root_traces</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Maximum number of root traces. The root trace is an execution flow taking one path through the code firstly,
|
||
which is a unit of JIT compilation. JIT will not compile new code if it reaches this limit.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-side-traces">
|
||
<term>
|
||
<parameter>opcache.jit_max_side_traces</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Maximum number of side traces a root trace may have. The side trace is another execution flow that does not
|
||
follow the path of compiled root trace. Side traces belonging to the same root trace will not be compiled
|
||
if it reaches this limit.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-exit-counters">
|
||
<term>
|
||
<parameter>opcache.jit_max_exit_counters</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Maximum number of side trace exit counters. This limits the total number of side traces
|
||
there may be, across all root traces.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-hot-loop">
|
||
<term>
|
||
<parameter>opcache.jit_hot_loop</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
After how many iterations a loop is considered hot.
|
||
Valid value range is <code>[0,255]</code>; for any setting out of this range,
|
||
e.g. <literal>-1</literal> or <literal>256</literal>, default value will be
|
||
used instead. <literal>0</literal> will disable JIT to trace and compile any loops.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-hot-func">
|
||
<term>
|
||
<parameter>opcache.jit_hot_func</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
After how many calls a function is considered hot.
|
||
Valid value range is <code>[0,255]</code>; for any setting out of this range,
|
||
e.g. <literal>-1</literal> or <literal>256</literal>, default value will be
|
||
used instead. <literal>0</literal> will disable JIT to trace and compile any functions.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-hot-return">
|
||
<term>
|
||
<parameter>opcache.jit_hot_return</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
After how many returns a return is considered hot.
|
||
Valid value range is <code>[0,255]</code>; for any setting out of this range,
|
||
e.g. <literal>-1</literal> or <literal>256</literal>, default value will be
|
||
used instead. <literal>0</literal> will disable JIT to trace and compile any returns.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-hot-side-exit">
|
||
<term>
|
||
<parameter>opcache.jit_hot_side_exit</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
After how many exits a side exit is considered hot.
|
||
Valid value range is <code>[0,255]</code>; for any setting out of this range,
|
||
e.g. <literal>-1</literal> or <literal>256</literal>, default value will be
|
||
used instead. <literal>0</literal> will disable JIT to trace and compile any side exits.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-blacklist-root-trace">
|
||
<term>
|
||
<parameter>opcache.jit_blacklist_root_trace</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
在将 root trace 列入黑名单之前,尝试编译 side trace 的最大次数。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-blacklist-side-trace">
|
||
<term>
|
||
<parameter>opcache.jit_blacklist_side_trace</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
在将 side trace 列入黑名单之前,尝试编译 side trace 的最大次数。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-loop-unrolls">
|
||
<term>
|
||
<parameter>opcache.jit_max_loop_unrolls</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
在 side trace 中展开循环的最大尝试次数,试图到达 root trace 并关闭外循环。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-recursive-calls">
|
||
<term>
|
||
<parameter>opcache.jit_max_recursive_calls</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
递归调用循环的最大展开次数。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-recursive-return">
|
||
<term>
|
||
<parameter>opcache.jit_max_recursive_returns</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
递归返回循环的最大展开次数。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="ini.opcache.jit-max-polymorphic-calls">
|
||
<term>
|
||
<parameter>opcache.jit_max_polymorphic_calls</parameter>
|
||
<type>int</type>
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
内联 polymorphic(动态或方法)调用的最大尝试次数。超过此限制的调用被视为 megamorphic,不会进行内联处理。
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</sect1>
|
||
<!-- Keep this comment at the end of the file
|
||
Local variables:
|
||
mode: sgml
|
||
sgml-omittag:t
|
||
sgml-shorttag:t
|
||
sgml-minimize-attributes:nil
|
||
sgml-always-quote-attributes:t
|
||
sgml-indent-step:1
|
||
sgml-indent-data:t
|
||
indent-tabs-mode:nil
|
||
sgml-parent-document:nil
|
||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||
sgml-exposed-tags:nil
|
||
sgml-local-catalogs:nil
|
||
sgml-local-ecat-files:nil
|
||
End:
|
||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||
vim: et tw=78 syn=sgml
|
||
vi: ts=1 sw=1
|
||
-->
|