[DOC-CVS] [doc-en] master: opcache: fix XML by converting para to simpara tags via script (#5128)
[email protected] (Gina Peter Banyard via GitHub)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Gina Peter Banyard (Girgias)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-01-18T19:37:59Z
Commit: https://github.com/php/doc-en/commit/87d6bb1bbd5f118f5b0cf0160438f06c0f91ea45
Raw diff: https://github.com/php/doc-en/commit/87d6bb1bbd5f118f5b0cf0160438f06c0f91ea45.diff
opcache: fix XML by converting para to simpara tags via script (#5128)
Changed paths:
M reference/opcache/book.xml
M reference/opcache/configure.xml
M reference/opcache/functions/opcache-compile-file.xml
M reference/opcache/functions/opcache-get-configuration.xml
M reference/opcache/functions/opcache-get-status.xml
M reference/opcache/functions/opcache-invalidate.xml
M reference/opcache/functions/opcache-is-script-cached.xml
M reference/opcache/functions/opcache-reset.xml
M reference/opcache/ini.xml
M reference/opcache/preload.xml
Diff:
diff --git a/reference/opcache/book.xml b/reference/opcache/book.xml
index 548bad8bbd65..db094a08cf9c 100644
--- a/reference/opcache/book.xml
+++ b/reference/opcache/book.xml
@@ -1,22 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-
-<book xml:id="book.opcache" xmlns="http://docbook.org/ns/docbook">
+<book xmlns="http://docbook.org/ns/docbook" xml:id="book.opcache">
<?phpdoc extension-membership="core" ?>
<title>OPcache</title>
<preface xml:id="intro.opcache">
&reftitle.intro;
- <para>
+ <simpara>
OPcache improves PHP performance by storing precompiled script bytecode in
shared memory, thereby removing the need for PHP to load and parse scripts
on each request.
- </para>
- <para>
+ </simpara>
+ <simpara>
This extension is bundled with PHP 5.5.0 and later, and is
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&url.pecl.package;ZendOpcache">available in PECL</link>
for PHP versions 5.2, 5.3 and 5.4.
- </para>
+ </simpara>
</preface>
&reference.opcache.setup;
@@ -24,7 +23,6 @@
&reference.opcache.reference;
</book>
-
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -45,4 +43,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-
diff --git a/reference/opcache/configure.xml b/reference/opcache/configure.xml
index f910101fdba6..571849662fe6 100644
--- a/reference/opcache/configure.xml
+++ b/reference/opcache/configure.xml
@@ -1,40 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<sect1 xml:id="opcache.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+<sect1 xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="opcache.installation">
&reftitle.install;
- <para>
+ <simpara>
OPcache can only be compiled as a shared extension. If you have
disabled the building of default extensions with
<option role="configure">--disable-all</option>, you must compile PHP with
the <option role="configure">--enable-opcache</option> option for OPcache
to be available.
- </para>
-
- <para>
+ </simpara>
+
+ <simpara>
Once compiled, you can use the
<link linkend="ini.zend-extension">zend_extension</link> configuration
directive to load the OPcache extension into PHP. This can be done with
<literal>zend_extension=/full/path/to/opcache.so</literal> on non-Windows
platforms, and <literal>zend_extension=C:\path\to\php_opcache.dll</literal>
on Windows.
- </para>
+ </simpara>
<note>
- <para>
+ <simpara>
If you want to use OPcache with
<link xlink:href="&url.xdebug;">Xdebug</link>, you must load OPcache before
Xdebug.
- </para>
+ </simpara>
</note>
<sect2 xml:id="opcache.installation.recommended">
<title>Recommended php.ini settings</title>
- <para>
+ <simpara>
The following settings are generally recommended as providing good
performance:
- </para>
+ </simpara>
<informalexample>
<programlisting>
@@ -49,7 +49,7 @@ opcache.enable_cli=1
</programlisting>
</informalexample>
- <para>
+ <simpara>
You may also want to consider disabling
<link linkend="ini.opcache.save-comments">opcache.save_comments</link>
and enabling
@@ -57,21 +57,20 @@ opcache.enable_cli=1
however note that you will have to test your code before using these in
production as they are known to break some frameworks and applications,
particularly in cases where documentation comment annotations are used.
- </para>
+ </simpara>
- <para>
+ <simpara>
On Windows, <link linkend="ini.opcache.file-cache-fallback">opcache.file_cache_fallback</link>
should be enabled, and <link linkend="ini.opcache.file-cache">opcache.file_cache</link>
should be set to an already existing and writable directory.
- </para>
+ </simpara>
- <para>
+ <simpara>
A full list of configuration directives supported by OPcache
<link linkend="opcache.configuration">is also available</link>.
- </para>
+ </simpara>
</sect2>
</sect1>
-
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
diff --git a/reference/opcache/functions/opcache-compile-file.xml b/reference/opcache/functions/opcache-compile-file.xml
index 409733ab9cb2..ae7d705e4b70 100644
--- a/reference/opcache/functions/opcache-compile-file.xml
+++ b/reference/opcache/functions/opcache-compile-file.xml
@@ -12,11 +12,11 @@
<type>bool</type><methodname>opcache_compile_file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
- <para>
+ <simpara>
This function compiles a PHP script and adds it to the opcode cache without
executing it. This can be used to prime the cache after a Web server
restart by pre-caching files that will be included in later requests.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +25,9 @@
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
- <para>
+ <simpara>
The path to the PHP script to be compiled.
- </para>
+ </simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -35,20 +35,20 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
- <para>
+ <simpara>
Returns &true; if <parameter>filename</parameter> was compiled successfully
&return.falseforfailure;.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
- <para>
+ <simpara>
If <parameter>filename</parameter> cannot be loaded or compiled, an error of
level <constant>E_WARNING</constant> is generated. You may use
<link linkend="language.operators.errorcontrol">@</link> to suppress this
warning.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="seealso">
diff --git a/reference/opcache/functions/opcache-get-configuration.xml b/reference/opcache/functions/opcache-get-configuration.xml
index 3021315a251d..ec855e01669e 100644
--- a/reference/opcache/functions/opcache-get-configuration.xml
+++ b/reference/opcache/functions/opcache-get-configuration.xml
@@ -12,9 +12,9 @@
<type class="union"><type>array</type><type>false</type></type><methodname>opcache_get_configuration</methodname>
<void/>
</methodsynopsis>
- <para>
+ <simpara>
This function returns configuration information about the cache instance
- </para>
+ </simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,18 +24,18 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
- <para>
+ <simpara>
Returns an array of information, including ini, blacklist and version
- </para>
+ </simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
- <para>
+ <simpara>
If <literal>opcache.restrict_api</literal> is in use and the current path
is in violation of the rule, an E_WARNING will be raised; no status information will
be returned.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="seealso">
diff --git a/reference/opcache/functions/opcache-get-status.xml b/reference/opcache/functions/opcache-get-status.xml
index c5d7f2489a1d..c0f974aab3e9 100644
--- a/reference/opcache/functions/opcache-get-status.xml
+++ b/reference/opcache/functions/opcache-get-status.xml
@@ -12,10 +12,10 @@
<type class="union"><type>array</type><type>false</type></type><methodname>opcache_get_status</methodname>
<methodparam choice="opt"><type>bool</type><parameter>include_scripts</parameter><initializer>&true;</initializer></methodparam>
</methodsynopsis>
- <para>
+ <simpara>
This function returns state information about the in-memory cache instance. It will not return any
information about the file cache.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,9 +24,9 @@
<varlistentry>
<term><parameter>include_scripts</parameter></term>
<listitem>
- <para>
+ <simpara>
Include script specific state information
- </para>
+ </simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -34,19 +34,19 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
- <para>
+ <simpara>
Returns an array of information, optionally containing script specific state information,
&return.falseforfailure;.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
- <para>
+ <simpara>
If <literal>opcache.restrict_api</literal> is in use and the current path
is in violation of the rule, an E_WARNING will be raised; no status information will
be returned.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="changelog">
diff --git a/reference/opcache/functions/opcache-invalidate.xml b/reference/opcache/functions/opcache-invalidate.xml
index 0d21b5054c51..8312c12d5b81 100644
--- a/reference/opcache/functions/opcache-invalidate.xml
+++ b/reference/opcache/functions/opcache-invalidate.xml
@@ -13,12 +13,12 @@
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>force</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
- <para>
+ <simpara>
This function invalidates a particular script from the opcode cache. If
<parameter>force</parameter> is unset or &false;, the script will only be
invalidated if the modification time of the script is newer than the cached
opcodes. This function only invalidates in-memory cache and not file cache.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="parameters">
@@ -27,18 +27,18 @@
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
- <para>
+ <simpara>
The path to the script being invalidated.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>force</parameter></term>
<listitem>
- <para>
+ <simpara>
If set to &true;, the script will be invalidated regardless of whether
invalidation is necessary.
- </para>
+ </simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -46,11 +46,11 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
- <para>
+ <simpara>
Returns &true; if the opcode cache for <parameter>filename</parameter> was
invalidated or if there was nothing to invalidate, or &false; if the opcode
cache is disabled.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="seealso">
diff --git a/reference/opcache/functions/opcache-is-script-cached.xml b/reference/opcache/functions/opcache-is-script-cached.xml
index ed3de87965bb..a850f1634ed9 100644
--- a/reference/opcache/functions/opcache-is-script-cached.xml
+++ b/reference/opcache/functions/opcache-is-script-cached.xml
@@ -12,11 +12,11 @@
<type>bool</type><methodname>opcache_is_script_cached</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
- <para>
+ <simpara>
This function checks if a PHP script has been cached in OPCache. This can be
used to more easily detect the "warming" of the cache for a particular script.
This function only checks in-memory cache, not file cache.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +25,9 @@
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
- <para>
+ <simpara>
The path to the PHP script to be checked.
- </para>
+ </simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -35,10 +35,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
- <para>
+ <simpara>
Returns &true; if <parameter>filename</parameter> is cached in OPCache,
&false; otherwise.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="seealso">
diff --git a/reference/opcache/functions/opcache-reset.xml b/reference/opcache/functions/opcache-reset.xml
index b0b06b521c42..823f1d112abe 100644
--- a/reference/opcache/functions/opcache-reset.xml
+++ b/reference/opcache/functions/opcache-reset.xml
@@ -12,12 +12,12 @@
<type>bool</type><methodname>opcache_reset</methodname>
<void/>
</methodsynopsis>
- <para>
+ <simpara>
This function resets the entire opcode cache. After calling
<function>opcache_reset</function>, all scripts will be reloaded and
reparsed the next time they are hit. This function only resets
in-memory cache, not the file cache.
- </para>
+ </simpara>
</refsect1>
<refsect1 role="parameters">
@@ -27,10 +27,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
- <para>
+ <simpara>
Returns &true; if the opcode cache was reset, or &false; if the opcode
cache is disabled or the restart is pending or in progress (see <function>opcache_get_status</function>).
- </para>
+ </simpara>
</refsect1>
<refsect1 role="seealso">
diff --git a/reference/opcache/ini.xml b/reference/opcache/ini.xml
index cac9e5f1bee6..80cd9eb6431a 100644
--- a/reference/opcache/ini.xml
+++ b/reference/opcache/ini.xml
@@ -379,12 +379,12 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Enables the opcode cache. When disabled, code is not optimised or
cached. The setting <literal>opcache.enable</literal> can not be
enabled at runtime through <function>ini_set</function>, it can only
be disabled. Trying to enable it in a script will generate a warning.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.enable-cli">
@@ -393,9 +393,9 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Enables the opcode cache for the CLI version of PHP.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.memory-consumption">
@@ -404,11 +404,11 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The size of the shared memory storage used by OPcache, in megabytes.
The minimum permissible value is <literal>"8"</literal>,
which is enforced if a smaller value is set.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.interned-strings-buffer">
@@ -417,11 +417,11 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The amount of memory used to store interned strings, in megabytes.
The maximum value is 32767 on 64bit architectures,
and 4095 on 32bit architectures.
- </para>
+ </simpara>
<note>
<simpara>
Prior to PHP 8.4.0, the maximum value was 4095 megabytes on all
@@ -436,7 +436,7 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The maximum number of keys (and therefore scripts) in the OPcache hash
table. The actual value used will be the first number in the set of
prime numbers
@@ -444,7 +444,7 @@
that is greater than or equal to the configured value. The minimum value is 200. The maximum
value is 1000000.
Values outside of this range are clamped to the permissible range.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.max-wasted-percentage">
@@ -453,12 +453,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The maximum percentage of wasted memory that is allowed before a restart
is scheduled, if there is insufficient free memory.
The maximum permissible value is <literal>"50"</literal>,
which is enforced if a larger value is set.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.use-cwd">
@@ -467,12 +467,12 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
If enabled, OPcache appends the current working directory to the script
key, thereby eliminating possible collisions between files with the same
base name. Disabling this directive improves performance, but may break
existing applications.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.validate-timestamps">
@@ -505,16 +505,16 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
How often to check script timestamps for updates, in seconds.
<literal>0</literal> will result in OPcache checking for updates on
every request.
- </para>
- <para>
+ </simpara>
+ <simpara>
This configuration directive is ignored if
<link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link>
is disabled.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.revalidate-path">
@@ -523,12 +523,12 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
If disabled, existing cached files using the same
<link linkend="ini.include-path">include_path</link> will be reused.
Thus, if a file with the same name is elsewhere in the include_path, it
won't be found.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.save-comments">
@@ -537,13 +537,13 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
If disabled, all documentation comments will be discarded from the
opcode cache to reduce the size of the optimised code. Disabling this
configuration directive may break applications and frameworks that rely
on comment parsing for annotations, including Doctrine, Zend Framework 2
and PHPUnit.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.fast-shutdown">
@@ -552,16 +552,16 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
If enabled, a fast shutdown sequence is used that doesn't free each
allocated block, but relies on the Zend Engine memory manager to
deallocate the entire set of request variables en masse.
- </para>
- <para>
+ </simpara>
+ <simpara>
This directive has been removed in PHP 7.2.0. A variant of the fast
shutdown sequence has been integrated into PHP and will be automatically
used if possible.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.enable-file-override">
@@ -570,7 +570,7 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
When enabled, the opcode cache will be checked for whether a file has
already been cached when <function>file_exists</function>,
<function>is_file</function> and <function>is_readable</function> are
@@ -579,7 +579,7 @@
if
<link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link>
is disabled.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.optimization-level">
@@ -588,12 +588,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
A bitmask that controls which optimisation passes are executed.
The default is to apply all safe optimizations.
Changing the default is mostly useful for debugging/developing the optimizer
(see also <link linkend="ini.opcache.opt_debug_level">opcache.opt_debug_level</link>).
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.inherited-hack">
@@ -602,9 +602,9 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
This configuration directive is ignored.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.dups-fix">
@@ -613,10 +613,10 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
This hack should only be enabled to work around "Cannot redeclare class"
errors.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.blacklist-filename">
@@ -625,15 +625,15 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
The location of the OPcache blacklist file. A blacklist file is a text
file containing the names of files that should not be accelerated, one
per line. Wildcards are allowed, and prefixes can also be provided.
Lines starting with a semi-colon are ignored as comments.
- </para>
- <para>
+ </simpara>
+ <simpara>
A simple blacklist file might look as follows:
- </para>
+ </simpara>
<informalexample>
<programlisting>
<![CDATA[
@@ -654,10 +654,10 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The maximum file size that will be cached, in bytes. If this is
<literal>0</literal>, all files will be cached.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.consistency-checks">
@@ -666,15 +666,15 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
If non-zero, OPcache will verify the cache checksum every N requests,
where N is the value of this configuration directive. This should only
be enabled when debugging, as it will impair performance.
- </para>
+ </simpara>
<note>
- <para>
+ <simpara>
Disabled as of 8.1.18 and 8.2.5. Removed as of PHP 8.3.0.
- </para>
+ </simpara>
</note>
</listitem>
</varlistentry>
@@ -684,21 +684,21 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The length of time to wait for a scheduled restart to begin if the cache
isn't active, in seconds. If the timeout is hit, then OPcache assumes
that something is wrong and will kill the processes holding locks on the
cache to permit a restart.
- </para>
- <para>
+ </simpara>
+ <simpara>
If
<link linkend="ini.opcache.log-verbosity-level">opcache.log_verbosity_level</link>
is set to 2 or above, a warning will be recorded in the error log when
this occurs.
- </para>
- <para>
+ </simpara>
+ <simpara>
This directive is not supported on Windows.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.error-log">
@@ -707,11 +707,11 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
The error log for OPcache errors. An empty string is treated the same as
<literal>stderr</literal>, and will result in logs being sent to
standard error (which will be the Web server error log in most cases).
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.log-verbosity-level">
@@ -720,11 +720,11 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The log verbosity level. By default, only fatal errors (level 0) and
errors (level 1) are logged. Other levels available are warnings (level
2), information messages (level 3) and debug messages (level 4).
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.record-warnings">
@@ -733,10 +733,10 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
If enabled, OPcache will record compile-time warnings and replay them on
the next include, even if it is served from cache.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.preferred-memory-model">
@@ -745,15 +745,15 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
The preferred memory model for OPcache to use. If left empty, OPcache
will choose the most appropriate model, which is the correct behaviour
in virtually all cases.
- </para>
- <para>
+ </simpara>
+ <simpara>
Possible values include <literal>mmap</literal>, <literal>shm</literal>,
<literal>posix</literal> and <literal>win32</literal>.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.protect-memory">
@@ -762,10 +762,10 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Protects shared memory from unexpected writes while executing scripts.
This is useful for internal debugging only.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.mmap-base">
@@ -774,12 +774,12 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
The base used for shared memory segments on Windows. All PHP processes
have to map shared memory into the same address space. Using this
directive allows "Unable to reattach to base address" errors to be
fixed.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.restrict-api">
@@ -788,11 +788,11 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Allows calling OPcache API functions only from PHP scripts which path
is started from specified string. The default <literal>""</literal>
means no restriction.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.file_update_protection">
@@ -801,12 +801,12 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Prevents caching files that are less than this number of seconds old.
It protects from caching of incompletely updated files. In case all file
updates are atomic, performance can be increased by setting this to <literal>0</literal>.
This will allow files to be cached immediately.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.huge_code_pages">
@@ -815,11 +815,11 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Enables or disables copying of PHP code (text segment) into HUGE PAGES.
This should improve performance, but requires appropriate OS configuration.
Available on Linux as of PHP 7.0.0, and on FreeBSD as of PHP 7.4.0.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.lockfile_path">
@@ -828,9 +828,9 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Absolute path used to store shared lockfiles (for *nix only)
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.opt_debug_level">
@@ -839,11 +839,11 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Produces opcode dumps for debugging different stages of optimizations.
0x10000 will output opcodes as the compiler produced them before any optimization occurs
while 0x20000 will output optimized codes.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.file-cache">
@@ -852,11 +852,11 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Enables and sets the second level cache directory. It should improve
performance when SHM memory is full, at server restart or SHM reset. The
default <literal>""</literal> disables file based caching.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.file-cache-only">
@@ -865,14 +865,14 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Enables or disables opcode caching in shared memory.
- </para>
+ </simpara>
<note>
- <para>
+ <simpara>
Prior to PHP 8.1.0, disabling this directive with an already populated
file cache required to manually clear the file cache.
- </para>
+ </simpara>
</note>
</listitem>
</varlistentry>
@@ -882,9 +882,9 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Enables or disables checksum validation when script loaded from file cache.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.file-cache-fallback">
@@ -893,11 +893,11 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Implies <code>opcache.file_cache_only=1</code> for a certain process that
failed to reattach to shared memory (Windows only). Explicitly enabling
the file cache is required.
- </para>
+ </simpara>
<caution>
<simpara>
Disabling this configuration option may prevent processes to start,
@@ -912,9 +912,9 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Validates the cached file permissions against the current user.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.validate-root">
@@ -923,10 +923,10 @@
<type>bool</type>
</term>
<listitem>
- <para>
+ <simpara>
Prevents name collisions in chroot'ed environments. This should be enabled in
all chroot'ed environments to prevent access to files outside the chroot.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.preload">
@@ -935,17 +935,17 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Specifies a PHP script that is going to be compiled and executed at server start-up,
and which may preload other files, either by <function>include</function>ing them or by
using the <function>opcache_compile_file</function> function. All the entities (e.g.
functions and classes) defined in these files will be available to requests out of
the box, until the server is shut down.
- </para>
+ </simpara>
<note>
- <para>
+ <simpara>
Preloading is not supported on Windows.
- </para>
+ </simpara>
</note>
</listitem>
</varlistentry>
@@ -955,14 +955,14 @@
<type>string</type>
</term>
<listitem>
- <para>
+ <simpara>
Lets the preloading to be run as the specified system user. This is useful for servers that
startup as root before switching to an unprivileged system user. Preloading as root is not
allowed by default for security reasons, unless this directive is explicitly set to
<literal>root</literal>.
As of PHP 8.3.0, this directive does not need to be set in order to allow preloading while
running as root when using the &cli.sapi; or <link linkend="book.phpdbg">phpdbg SAPI</link>.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.cache-id">
@@ -991,9 +991,9 @@
<type class="union"><type>string</type><type>int</type></type>
</term>
<listitem>
- <para>
+ <simpara>
For typical usage, this option accepts one of four string values:
- </para>
+ </simpara>
<simplelist>
<member><literal>disable</literal>: Completely disabled, cannot be enabled at runtime.</member>
<member><literal>off</literal>: Disabled, but can be enabled at runtime.</member>
@@ -1069,9 +1069,9 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
The amount of shared memory to reserve for compiled JIT code. A zero value disables the JIT.
- </para>
+ </simpara>
&ini.shorthandbytes;
</listitem>
</varlistentry>
@@ -1081,12 +1081,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
A bit mask specifying which JIT debug output to enable.
For possible values, please consult
<link xlink:href="&url.php.git.src.master.view;ext/opcache/jit/zend_jit.h">zend_jit.h</link>
(search for macro definitions beginning with <code>ZEND_JIT_DEBUG</code>).
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-bisect-limit">
@@ -1095,12 +1095,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Debugging option that disables JIT compilation after compiling a certain number of functions.
This may be helpful to bisect the source of a JIT miscompilation. Note: this option only works
when JIT trigger is set to 0 (compile on script load) or 1 (compile on first execution),
e.g. <code>opcache.jit=1215</code>. See more in <link linkend="ini.opcache.jit">opcache.jit</link> option.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-prof-threshold">
@@ -1109,12 +1109,12 @@
<type>float</type>
</term>
<listitem>
- <para>
+ <simpara>
When using the "profile on first request" trigger mode, this threshold determines whether a
function is considered hot. The number of calls to the function divided by the number of calls
to all functions must be above the threshold. For example, a threshold of 0.005 means that
functions that made up more than 0.5% of all calls will be JIT compiled.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-root-traces">
@@ -1123,10 +1123,10 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <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.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-side-traces">
@@ -1135,11 +1135,11 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <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.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-exit-counters">
@@ -1148,10 +1148,10 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of side trace exit counters. This limits the total number of side traces
there may be, across all root traces.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-hot-loop">
@@ -1160,12 +1160,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <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.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-hot-func">
@@ -1174,12 +1174,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <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.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-hot-return">
@@ -1188,12 +1188,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <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.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-hot-side-exit">
@@ -1202,12 +1202,12 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <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.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-blacklist-root-trace">
@@ -1216,9 +1216,9 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of times the compilation of a root trace is attempted before it is blacklisted.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-blacklist-side-trace">
@@ -1227,9 +1227,9 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of times the compilation of a side trace is attempted before it is blacklisted.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-loop-unrolls">
@@ -1238,10 +1238,10 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of attempts to unroll a loop in a side trace,
trying to reach the root trace and close the outer loop.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-recursive-calls">
@@ -1250,9 +1250,9 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of unrolled recursive call loops.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-recursive-return">
@@ -1261,9 +1261,9 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of unrolled recursive return loops.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.jit-max-polymorphic-calls">
@@ -1272,10 +1272,10 @@
<type>int</type>
</term>
<listitem>
- <para>
+ <simpara>
Maximum number of attempts to inline polymorphic (dynamic or method) calls.
Calls above this limit are treated as megamorphic and are not inlined.
- </para>
+ </simpara>
</listitem>
</varlistentry>
</variablelist>
diff --git a/reference/opcache/preload.xml b/reference/opcache/preload.xml
index 807426c3f3ed..e0abb39e1c99 100644
--- a/reference/opcache/preload.xml
+++ b/reference/opcache/preload.xml
@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<chapter xml:id="opcache.preloading" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="opcache.preloading">
<title>Preloading</title>
- <para>
+ <simpara>
As of PHP 7.4.0, PHP can be configured to preload scripts into the opcache when the engine
starts. Any functions, classes, interfaces, or traits (but not constants) in those files will then become
globally available for all requests without needing to be explicitly included. That trades
convenience and performance (because the code is always available) for baseline memory usage. It also
requires restarting the PHP process to clear pre-loaded scripts, meaning this feature is
only practical to use in production, not in a development environment.
- </para>
+ </simpara>
- <para>
+ <simpara>
Note that the optimal tradeoff between performance and memory may vary with the application.
"Preload everything" may be the easiest strategy, but not necessarily the best strategy. Additionally,
preloading is only useful when there is a persistent process from one request to another. That means
while it can work in a CLI script if the opcache is enabled, it's generally pointless. The exception
is when using preloading on <link linkend="ffi.examples-complete">FFI libraries</link>.
- </para>
+ </simpara>
<note>
- <para>
+ <simpara>
Preloading is not supported on Windows.
- </para>
+ </simpara>
</note>
- <para>
+ <simpara>
Configuring preloading involves two steps, and requires that the opcache be enabled.
First, set the <link linkend="ini.opcache.preload">opcache.preload</link>
value in &php.ini;:
- </para>
+ </simpara>
<informalexample>
<programlisting role="ini">
@@ -40,22 +40,22 @@ opcache.preload=preload.php
</programlisting>
</informalexample>
- <para>
+ <simpara>
<filename>preload.php</filename> is an arbitrary file that will run once at server startup
(PHP-FPM, mod_php, etc.) and load code into persistent memory. In servers that startup as
root before switching to an unprivileged system user, or if PHP will be run as root
(not recommended), the <link linkend="ini.opcache.preload-user">opcache.preload_user</link>
value can specify the system user to run the preloading. Running preloading as root is not allowed
by default. Set <literal>opcache.preload_user=root</literal> to explicitly allow it.
- </para>
+ </simpara>
- <para>
+ <simpara>
In the <filename>preload.php</filename> script, any file referenced by <function>include</function>,
<function>include_once</function>, <function>require</function>, <function>require_once</function>, or
<function>opcache_compile_file</function> will be parsed into persistent memory. In the following example,
all <filename class="extension">.php</filename> files in the <filename>src</filename> directory will be preloaded, unless they
are a <literal>Test</literal> file.
- </para>
+ </simpara>
<informalexample>
<programlisting role="php">
@@ -101,7 +101,6 @@ foreach ($phpFiles as $key => $file) {
</para>
</chapter>
-
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml