1 ;From ZendOpcache README file |
|
2 |
|
3 zend_extension=/usr/php/PHP_VERSION/modules/opcache.so |
|
4 |
|
5 ;NOTE: In case you are going to use Zend OPcache together with Xdebug, |
|
6 ;be sure that Xdebug is loaded after OPcache. "php -v" must show Xdebug |
|
7 ;after OPcache. |
|
8 ; |
|
9 ;Speed Tuning |
|
10 ;------------- |
|
11 ; |
|
12 ;We recommend the following configuration options for best performance. |
|
13 |
|
14 opcache.memory_consumption=128 |
|
15 opcache.interned_strings_buffer=8 |
|
16 opcache.max_accelerated_files=4000 |
|
17 opcache.revalidate_freq=60 |
|
18 opcache.fast_shutdown=1 |
|
19 opcache.enable_cli=1 |
|
20 |
|
21 ;You also may add the following, but it may break some applications and |
|
22 ;frameworks. Please, read description of these directives and add them on your |
|
23 ;own risk. |
|
24 |
|
25 ;opcache.save_comments=0 |
|
26 ;opcache.enable_file_override=1 |
|
27 |
|
28 ;In some cases you may like to prefer enabling/disabling some features |
|
29 ;to avoid incompatibilities at the cost of some performance degradation. |
|
30 ; |
|
31 ;Configuration Directives |
|
32 ;------------------------ |
|
33 ; |
|
34 ;opcache.enable (default "1") |
|
35 ; OPcache On/Off switch. When set to Off, code is not optimized and cached. |
|
36 ; |
|
37 ;opcache.enable_cli (default "0") |
|
38 ; Enables the OPcache for the CLI version of PHP. It's mostly for testing |
|
39 ; and debugging. |
|
40 ; |
|
41 ;opcache.memory_consumption (default "64") |
|
42 ; The OPcache shared memory storage size. The amount of memory for storing |
|
43 ; precompiled PHP code in Mbytes. |
|
44 ; |
|
45 ;opcache.interned_strings_buffer (default "4") |
|
46 ; The amount of memory for interned strings in Mbytes. |
|
47 ; |
|
48 ;opcache.max_accelerated_files (default "2000") |
|
49 ; The maximum number of keys (scripts) in the OPcache hash table. |
|
50 ; The number is actually the first one in the following set of prime |
|
51 ; numbers that is bigger than the one supplied: { 223, 463, 983, 1979, 3907, |
|
52 ; 7963, 16229, 32531, 65407, 130987 }. Only numbers between 200 and 100000 |
|
53 ; are allowed. |
|
54 ; |
|
55 ;opcache.max_wasted_percentage (default "5") |
|
56 ; The maximum percentage of "wasted" memory until a restart is scheduled. |
|
57 ; |
|
58 ;opcache.use_cwd (default "1") |
|
59 ; When this directive is enabled, the OPcache appends the current working |
|
60 ; directory to the script key, thus eliminating possible collisions between |
|
61 ; files with the same name (basename). Disabling the directive improves |
|
62 ; performance, but may break existing applications. |
|
63 ; |
|
64 ;opcache.validate_timestamps (default "1") |
|
65 ; When disabled, you must reset the OPcache manually or restart the |
|
66 ; webserver for changes to the filesystem to take effect. |
|
67 ; The frequency of the check is controlled by the directive |
|
68 ; "opcache.revalidate_freq". |
|
69 ; |
|
70 ;opcache.revalidate_freq (default "2") |
|
71 ; How often (in seconds) to check file timestamps for changes to the shared |
|
72 ; memory storage allocation. ("1" means validate once per second, but only |
|
73 ; once per request. "0" means always validate) |
|
74 ; |
|
75 ;opcache.revalidate_path (default "0") |
|
76 ; Enables or disables file search in include_path optimization |
|
77 ; If the file search is disabled and a cached file is found that uses |
|
78 ; the same include_path, the file is not searched again. Thus, if a file |
|
79 ; with the same name appears somewhere else in include_path, it |
|
80 ; won't be found. Enable this directive if this optimization has an effect on |
|
81 ; your applications. The default for this directive is disabled, which means |
|
82 ; that optimization is active. |
|
83 ; |
|
84 ;opcache.save_comments (default "1") |
|
85 ; If disabled, all PHPDoc comments are dropped from the code to reduce the |
|
86 ; size of the optimized code. Disabling "Doc Comments" may break some |
|
87 ; existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit) |
|
88 ; |
|
89 ;opcache.load_comments (default "1") |
|
90 ; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments" |
|
91 ; may be always stored (save_comments=1), but not loaded by applications |
|
92 ; that don't need them anyway. |
|
93 ; |
|
94 ;opcache.fast_shutdown (default "0") |
|
95 ; If enabled, a fast shutdown sequence is used for the accelerated code |
|
96 ; The fast shutdown sequence doesn't free each allocated block, but lets |
|
97 ; the Zend Engine Memory Manager do the work. |
|
98 ; |
|
99 ;opcache.enable_file_override (default "0") |
|
100 ; Allow file existence override (file_exists, etc.) performance feature. |
|
101 ; |
|
102 ;opcache.optimization_level (default "0xffffffff") |
|
103 ; A bitmask, where each bit enables or disables the appropriate OPcache |
|
104 ; passes |
|
105 ; |
|
106 ;opcache.inherited_hack (default "1") |
|
107 ; Enable this hack as a workaround for "can't redeclare class" errors. |
|
108 ; The OPcache stores the places where DECLARE_CLASS opcodes use |
|
109 ; inheritance (These are the only opcodes that can be executed by PHP, |
|
110 ; but which may not be executed because the parent class is missing due to |
|
111 ; optimization). When the file is loaded, OPcache tries to bind the |
|
112 ; inherited classes by using the current environment. The problem with this |
|
113 ; scenario is that, while the DECLARE_CLASS opcode may not be needed for the |
|
114 ; current script, if the script requires that the opcode at least be defined, |
|
115 ; it may not run. The default for this directive is disabled, which means |
|
116 ; that optimization is active. In php-5.3 and above this hack is not needed |
|
117 ; anymore and this setting has no effect. |
|
118 ; |
|
119 ;opcache.dups_fix (default "0") |
|
120 ; Enable this hack as a workaround for "Cannot redeclare class" errors. |
|
121 ; |
|
122 ;opcache.blacklist_filename |
|
123 ; The location of the OPcache blacklist file (wildcards allowed). |
|
124 ; Each OPcache blacklist file is a text file that holds the names of files |
|
125 ; that should not be accelerated. The file format is to add each filename |
|
126 ; to a new line. The filename may be a full path or just a file prefix |
|
127 ; (i.e., /var/www/x blacklists all the files and directories in /var/www |
|
128 ; that start with 'x'). Line starting with a ; are ignored (comments). |
|
129 ; Files are usually triggered by one of the following three reasons: |
|
130 ; 1) Directories that contain auto generated code, like Smarty or ZFW cache. |
|
131 ; 2) Code that does not work well when accelerated, due to some delayed |
|
132 ; compile time evaluation. |
|
133 ; 3) Code that triggers an OPcache bug. |
|
134 ; |
|
135 ;opcache.max_file_size (default "0") |
|
136 ; Allows exclusion of large files from being cached. By default all files |
|
137 ; are cached. |
|
138 ; |
|
139 ;opcache.consistency_checks (default "0") |
|
140 ; Check the cache checksum each N requests. |
|
141 ; The default value of "0" means that the checks are disabled. |
|
142 ; Because calculating the checksum impairs performance, this directive should |
|
143 ; be enabled only as part of a debugging process. |
|
144 ; |
|
145 ;opcache.force_restart_timeout (default "180") |
|
146 ; How long to wait (in seconds) for a scheduled restart to begin if the cache |
|
147 ; is not being accessed. |
|
148 ; The OPcache uses this directive to identify a situation where there may |
|
149 ; be a problem with a process. After this time period has passed, the |
|
150 ; OPcache assumes that something has happened and starts killing the |
|
151 ; processes that still hold the locks that are preventing a restart. |
|
152 ; If the log level is 3 or above, a "killed locker" error is recorded |
|
153 ; in the Apache logs when this happens. |
|
154 ; |
|
155 ;opcache.error_log |
|
156 ; OPcache error_log file name. Empty string assumes "stderr". |
|
157 ; |
|
158 ;opcache.log_verbosity_level (default "1") |
|
159 ; All OPcache errors go to the Web server log. |
|
160 ; By default, only fatal errors (level 0) or errors (level 1) are logged. |
|
161 ; You can also enable warnings (level 2), info messages (level 3) or |
|
162 ; debug messages (level 4). |
|
163 ; |
|
164 ;opcache.preferred_memory_model |
|
165 ; Preferred Shared Memory back-end. Leave empty and let the system decide. |
|
166 ; |
|
167 ;opcache.protect_memory (default "0") |
|
168 ; Protect the shared memory from unexpected writing during script execution. |
|
169 ; Useful for internal debugging only. |
|
170 ; |
|
171 ;opcache.mmap_base |
|
172 ; Mapping base of shared memory segments (for Windows only). All the PHP |
|
173 ; processes have to map shared memory into the same address space. This |
|
174 ; directive allows to manually fix the "Unable to reattach to base address" |
|
175 ; errors. |
|