php-doc-en/reference/opcache/ini.xml

612 lines
19 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="opcache.configuration" xmlns="http://docbook.org/ns/docbook">
&reftitle.runtime;
&extension.runtime;
<para>
<table>
<title>OPcache configuration options</title>
<tgroup cols="4">
<thead>
<row>
<entry>&Name;</entry>
<entry>&Default;</entry>
<entry>&Changeable;</entry>
<entry>&Changelog;</entry>
</row>
</thead>
<tbody>
<row>
<entry><link linkend="ini.opcache.enable">opcache.enable</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.enable-cli">opcache.enable_cli</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link
linkend="ini.opcache.memory-consumption">opcache.memory_consumption</link></entry>
<entry>"64"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.interned-strings-buffer">opcache.interned_strings_buffer</link></entry>
<entry>"4"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.max-accelerated-files">opcache.max_accelerated_files</link></entry>
<entry>"2000"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.max-wasted-percentage">opcache.max_wasted_percentage</link></entry>
<entry>"5"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.use-cwd">opcache.use_cwd</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.revalidate-freq">opcache.revalidate_freq</link></entry>
<entry>"2"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.revalidate-path">opcache.revalidate_path</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.save-comments">opcache.save_comments</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.load-comments">opcache.load_comments</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.fast-shutdown">opcache.fast_shutdown</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.enable-file-override">opcache.enable_file_override</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.optimization-level">opcache.optimization_level</link></entry>
<entry>"0xffffffff"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.inherited-hack">opcache.inherited_hack</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.dups-fix">opcache.dups_fix</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.blacklist-filename">opcache.blacklist_filename</link></entry>
<entry>""</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.max-file-size">opcache.max_file_size</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.consistency-checks">opcache.consistency_checks</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.force-restart-timeout">opcache.force_restart_timeout</link></entry>
<entry>"180"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.error-log">opcache.error_log</link></entry>
<entry>""</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.log-verbosity-level">opcache.log_verbosity_level</link></entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.preferred-memory-model">opcache.preferred_memory_model</link></entry>
<entry>""</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.protect-memory">opcache.protect_memory</link></entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.mmap-base">opcache.mmap_base</link></entry>
<entry>&null;</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
<row>
<entry><link linkend="ini.opcache.restrict-api">opcache.restrict_api</link></entry>
<entry>""</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
&ini.php.constants;
</para>
&ini.descriptions.title;
<para>
<variablelist>
<varlistentry xml:id="ini.opcache.enable">
<term>
<parameter>opcache.enable</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
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 at in a script will generate a warning.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.enable-cli">
<term>
<parameter>opcache.enable_cli</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Enables the opcode cache for the CLI version of PHP. This is mostly
useful for testing and debugging.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.memory-consumption">
<term>
<parameter>opcache.memory_consumption</parameter>
<type>integer</type>
</term>
<listitem>
<para>
The size of the shared memory storage used by OPcache, in megabytes.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.interned-strings-buffer">
<term>
<parameter>opcache.interned_strings_buffer</parameter>
<type>integer</type>
</term>
<listitem>
<para>
The amount of memory used to store interned strings, in megabytes. This
configuration directive is ignored in PHP &lt; 5.3.0.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.max-accelerated-files">
<term>
<parameter>opcache.max_accelerated_files</parameter>
<type>integer</type>
</term>
<listitem>
<para>
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
<literal>{ 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987 }</literal>
that is bigger than the configured value. Only numbers between 200 and
100000 are allowed.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.max-wasted-percentage">
<term>
<parameter>opcache.max_wasted_percentage</parameter>
<type>integer</type>
</term>
<listitem>
<para>
The maximum percentage of wasted memory that is allowed before a restart
is scheduled.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.use-cwd">
<term>
<parameter>opcache.use_cwd</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.validate-timestamps">
<term>
<parameter>opcache.validate_timestamps</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
If enabled, OPcache will check for updated scripts every
<link linkend="ini.opcache.revalidate-freq">opcache.revalidate_freq</link>
seconds. When this directive is disabled, you must reset OPcache
manually via <function>opcache_reset</function>,
<function>opcache_invalidate</function> or by restarting the Web server
for changes to the filesystem to take effect.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.revalidate-freq">
<term>
<parameter>opcache.revalidate_freq</parameter>
<type>integer</type>
</term>
<listitem>
<para>
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>
This configuration directive is ignored if
<link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link>
is disabled.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.revalidate-path">
<term>
<parameter>opcache.revalidate_path</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.save-comments">
<term>
<parameter>opcache.save_comments</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.load-comments">
<term>
<parameter>opcache.load_comments</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
If disabled, documentation comments won't be loaded from the opcode
cache even if they exist. This can be used with
<link linkend="ini.opcache.save-comments">opcache.save_comments</link>
to only load comments for applications that require them.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.fast-shutdown">
<term>
<parameter>opcache.fast_shutdown</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.enable-file-override">
<term>
<parameter>opcache.enable_file_override</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
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
called. This may increase performance in applications that check the
existence and readability of PHP scripts, but risks returning stale data
if
<link linkend="ini.opcache.validate-timestamps">opcache.validate_timestamps</link>
is disabled.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.optimization-level">
<term>
<parameter>opcache.optimization_level</parameter>
<type>integer</type>
</term>
<listitem>
<para>
A bitmask that controls which optimisation passes are executed.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.inherited-hack">
<term>
<parameter>opcache.inherited_hack</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
In PHP &lt; 5.3, OPcache stores the places where
<link linkend="internals2.opcodes.declare-class">DECLARE_CLASS</link>
opcodes used inheritance; when the file is loaded, OPcache then tries to
bind the inherited classes using the current environment. The problem is
that while the DECLARE_CLASS opcode may not be needed for the current
script, if the script requires that the opcode be defined, it may not
run.
</para>
<para>
This configuration directive is ignored in PHP 5.3 and later.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.dups-fix">
<term>
<parameter>opcache.dups_fix</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
This hack should only be enabled to work around "Cannot redeclare class"
errors.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.blacklist-filename">
<term>
<parameter>opcache.blacklist_filename</parameter>
<type>string</type>
</term>
<listitem>
<para>
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>
A simple blacklist file might look as follows:
</para>
<informalexample>
<programlisting>
<![CDATA[
; Matches a specific file.
/var/www/broken.php
; A prefix that matches all files starting with x.
/var/www/x
; A wildcard match.
/var/www/*-broken.php
]]>
</programlisting>
</informalexample>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.max-file-size">
<term>
<parameter>opcache.max_file_size</parameter>
<type>integer</type>
</term>
<listitem>
<para>
The maximum file size that will be cached, in bytes. If this is
<literal>0</literal>, all files will be cached.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.consistency-checks">
<term>
<parameter>opcache.consistency_checks</parameter>
<type>integer</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.force-restart-timeout">
<term>
<parameter>opcache.force_restart_timeout</parameter>
<type>integer</type>
</term>
<listitem>
<para>
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>
If
<link linkend="ini.opcache.log-verbosity-level">opcache.log_verbosity_level</link>
is set to 3 or above, an error will be recorded in the error log when
this occurs.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.error-log">
<term>
<parameter>opcache.error_log</parameter>
<type>string</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.log-verbosity-level">
<term>
<parameter>opcache.log_verbosity_level</parameter>
<type>integer</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.preferred-memory-model">
<term>
<parameter>opcache.preferred_memory_model</parameter>
<type>string</type>
</term>
<listitem>
<para>
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>
Possible values include <literal>mmap</literal>, <literal>shm</literal>,
<literal>posix</literal> and <literal>win32</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.protect-memory">
<term>
<parameter>opcache.protect_memory</parameter>
<type>boolean</type>
</term>
<listitem>
<para>
Protects shared memory from unexpected writes while executing scripts.
This is useful for internal debugging only.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.mmap-base">
<term>
<parameter>opcache.mmap_base</parameter>
<type>string</type>
</term>
<listitem>
<para>
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>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.opcache.restrict-api">
<term>
<parameter>opcache.restrict_api</parameter>
<type>string</type>
</term>
<listitem>
<para>
Allows calling OPcache API functions only from PHP scripts which path
is started from specified string. The default "" means no restriction.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</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
-->