opcache.ini revision 2429
2429N/A;From ZendOpcache README file
2429N/A
2429N/Azend_extension=/usr/php/PHP_VERSION/modules/opcache.so
2429N/A
2429N/A;NOTE: In case you are going to use Zend OPcache together with Xdebug,
2429N/A;be sure that Xdebug is loaded after OPcache. "php -v" must show Xdebug
2429N/A;after OPcache.
2429N/A;
2429N/A;Speed Tuning
2429N/A;-------------
2429N/A;
2429N/A;We recommend the following configuration options for best performance.
2429N/A
2429N/Aopcache.memory_consumption=128
2429N/Aopcache.interned_strings_buffer=8
2429N/Aopcache.max_accelerated_files=4000
2429N/Aopcache.revalidate_freq=60
2429N/Aopcache.fast_shutdown=1
2429N/Aopcache.enable_cli=1
2429N/A
2429N/A;You also may add the following, but it may break some applications and
2429N/A;frameworks. Please, read description of these directives and add them on your
2429N/A;own risk.
2429N/A
2429N/A;opcache.save_comments=0
2429N/A;opcache.enable_file_override=1
2429N/A
2429N/A;In some cases you may like to prefer enabling/disabling some features
2429N/A;to avoid incompatibilities at the cost of some performance degradation.
2429N/A;
2429N/A;Configuration Directives
2429N/A;------------------------
2429N/A;
2429N/A;opcache.enable (default "1")
2429N/A; OPcache On/Off switch. When set to Off, code is not optimized and cached.
2429N/A;
2429N/A;opcache.enable_cli (default "0")
2429N/A; Enables the OPcache for the CLI version of PHP. It's mostly for testing
2429N/A; and debugging.
2429N/A;
2429N/A;opcache.memory_consumption (default "64")
2429N/A; The OPcache shared memory storage size. The amount of memory for storing
2429N/A; precompiled PHP code in Mbytes.
2429N/A;
2429N/A;opcache.interned_strings_buffer (default "4")
2429N/A; The amount of memory for interned strings in Mbytes.
2429N/A;
2429N/A;opcache.max_accelerated_files (default "2000")
2429N/A; The maximum number of keys (scripts) in the OPcache hash table.
2429N/A; The number is actually the first one in the following set of prime
2429N/A; numbers that is bigger than the one supplied: { 223, 463, 983, 1979, 3907,
2429N/A; 7963, 16229, 32531, 65407, 130987 }. Only numbers between 200 and 100000
2429N/A; are allowed.
2429N/A;
2429N/A;opcache.max_wasted_percentage (default "5")
2429N/A; The maximum percentage of "wasted" memory until a restart is scheduled.
2429N/A;
2429N/A;opcache.use_cwd (default "1")
2429N/A; When this directive is enabled, the OPcache appends the current working
2429N/A; directory to the script key, thus eliminating possible collisions between
2429N/A; files with the same name (basename). Disabling the directive improves
2429N/A; performance, but may break existing applications.
2429N/A;
2429N/A;opcache.validate_timestamps (default "1")
2429N/A; When disabled, you must reset the OPcache manually or restart the
2429N/A; webserver for changes to the filesystem to take effect.
2429N/A; The frequency of the check is controlled by the directive
2429N/A; "opcache.revalidate_freq".
2429N/A;
2429N/A;opcache.revalidate_freq (default "2")
2429N/A; How often (in seconds) to check file timestamps for changes to the shared
2429N/A; memory storage allocation. ("1" means validate once per second, but only
2429N/A; once per request. "0" means always validate)
2429N/A;
2429N/A;opcache.revalidate_path (default "0")
2429N/A; Enables or disables file search in include_path optimization
2429N/A; If the file search is disabled and a cached file is found that uses
2429N/A; the same include_path, the file is not searched again. Thus, if a file
2429N/A; with the same name appears somewhere else in include_path, it
2429N/A; won't be found. Enable this directive if this optimization has an effect on
2429N/A; your applications. The default for this directive is disabled, which means
2429N/A; that optimization is active.
2429N/A;
2429N/A;opcache.save_comments (default "1")
2429N/A; If disabled, all PHPDoc comments are dropped from the code to reduce the
2429N/A; size of the optimized code. Disabling "Doc Comments" may break some
2429N/A; existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)
2429N/A;
2429N/A;opcache.load_comments (default "1")
2429N/A; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
2429N/A; may be always stored (save_comments=1), but not loaded by applications
2429N/A; that don't need them anyway.
2429N/A;
2429N/A;opcache.fast_shutdown (default "0")
2429N/A; If enabled, a fast shutdown sequence is used for the accelerated code
2429N/A; The fast shutdown sequence doesn't free each allocated block, but lets
2429N/A; the Zend Engine Memory Manager do the work.
2429N/A;
2429N/A;opcache.enable_file_override (default "0")
2429N/A; Allow file existence override (file_exists, etc.) performance feature.
2429N/A;
2429N/A;opcache.optimization_level (default "0xffffffff")
2429N/A; A bitmask, where each bit enables or disables the appropriate OPcache
2429N/A; passes
2429N/A;
2429N/A;opcache.inherited_hack (default "1")
2429N/A; Enable this hack as a workaround for "can't redeclare class" errors.
2429N/A; The OPcache stores the places where DECLARE_CLASS opcodes use
2429N/A; inheritance (These are the only opcodes that can be executed by PHP,
2429N/A; but which may not be executed because the parent class is missing due to
2429N/A; optimization). When the file is loaded, OPcache tries to bind the
2429N/A; inherited classes by using the current environment. The problem with this
2429N/A; scenario is that, while the DECLARE_CLASS opcode may not be needed for the
2429N/A; current script, if the script requires that the opcode at least be defined,
2429N/A; it may not run. The default for this directive is disabled, which means
2429N/A; that optimization is active. In php-5.3 and above this hack is not needed
2429N/A; anymore and this setting has no effect.
2429N/A;
2429N/A;opcache.dups_fix (default "0")
2429N/A; Enable this hack as a workaround for "Cannot redeclare class" errors.
2429N/A;
2429N/A;opcache.blacklist_filename
2429N/A; The location of the OPcache blacklist file (wildcards allowed).
2429N/A; Each OPcache blacklist file is a text file that holds the names of files
2429N/A; that should not be accelerated. The file format is to add each filename
2429N/A; to a new line. The filename may be a full path or just a file prefix
2429N/A; (i.e., /var/www/x blacklists all the files and directories in /var/www
2429N/A; that start with 'x'). Line starting with a ; are ignored (comments).
2429N/A; Files are usually triggered by one of the following three reasons:
2429N/A; 1) Directories that contain auto generated code, like Smarty or ZFW cache.
2429N/A; 2) Code that does not work well when accelerated, due to some delayed
2429N/A; compile time evaluation.
2429N/A; 3) Code that triggers an OPcache bug.
2429N/A;
2429N/A;opcache.max_file_size (default "0")
2429N/A; Allows exclusion of large files from being cached. By default all files
2429N/A; are cached.
2429N/A;
2429N/A;opcache.consistency_checks (default "0")
2429N/A; Check the cache checksum each N requests.
2429N/A; The default value of "0" means that the checks are disabled.
2429N/A; Because calculating the checksum impairs performance, this directive should
2429N/A; be enabled only as part of a debugging process.
2429N/A;
2429N/A;opcache.force_restart_timeout (default "180")
2429N/A; How long to wait (in seconds) for a scheduled restart to begin if the cache
2429N/A; is not being accessed.
2429N/A; The OPcache uses this directive to identify a situation where there may
2429N/A; be a problem with a process. After this time period has passed, the
2429N/A; OPcache assumes that something has happened and starts killing the
2429N/A; processes that still hold the locks that are preventing a restart.
2429N/A; If the log level is 3 or above, a "killed locker" error is recorded
2429N/A; in the Apache logs when this happens.
2429N/A;
2429N/A;opcache.error_log
2429N/A; OPcache error_log file name. Empty string assumes "stderr".
2429N/A;
2429N/A;opcache.log_verbosity_level (default "1")
2429N/A; All OPcache errors go to the Web server log.
2429N/A; By default, only fatal errors (level 0) or errors (level 1) are logged.
2429N/A; You can also enable warnings (level 2), info messages (level 3) or
2429N/A; debug messages (level 4).
2429N/A;
2429N/A;opcache.preferred_memory_model
2429N/A; Preferred Shared Memory back-end. Leave empty and let the system decide.
2429N/A;
2429N/A;opcache.protect_memory (default "0")
2429N/A; Protect the shared memory from unexpected writing during script execution.
2429N/A; Useful for internal debugging only.
2429N/A;
2429N/A;opcache.mmap_base
2429N/A; Mapping base of shared memory segments (for Windows only). All the PHP
2429N/A; processes have to map shared memory into the same address space. This
2429N/A; directive allows to manually fix the "Unable to reattach to base address"
2429N/A; errors.