Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>OPcache replaces APC</h2> <p>Because OPcache is designed to replace the APC module, it is not possible to run them in parallel in PHP. This is fine for caching PHP opcode as neither affects how you write code.</p> <p>However it means that if you are currently using APC to store other data (through the <a href="http://php.net/manual/en/function.apc-store.php"><code>apc_store()</code></a> function) you will not be able to do that if you decide to use OPCache.</p> <p>You will need to use another library such as either <a href="https://github.com/krakjoe/apcu">APCu</a> or <a href="https://github.com/laruence/yac">Yac</a> which both store data in shared PHP memory, or switch to use something like memcached, which stores data in memory in a separate process to PHP.</p> <p>Also, OPcache has no equivalent of the upload progress meter present in APC. Instead you should use the <a href="http://php.net/manual/en/session.upload-progress.php">Session Upload Progress</a>.</p> <h2>Settings for OPcache</h2> <p>The documentation for OPcache can be found <a href="http://uk3.php.net/manual/en/book.opcache.php">here</a> with all of the configuration options listed <a href="http://php.net/manual/en/opcache.configuration.php">here</a>. The recommended settings are:</p> <pre class="lang-lisp prettyprint-override"><code>; Sets how much memory to use opcache.memory_consumption=128 ;Sets how much memory should be used by OPcache for storing internal strings ;(e.g. classnames and the files they are contained in) opcache.interned_strings_buffer=8 ; The maximum number of files OPcache will cache opcache.max_accelerated_files=4000 ;How often (in seconds) to check file timestamps for changes to the shared ;memory storage allocation. opcache.revalidate_freq=60 ;If enabled, a fast shutdown sequence is used for the accelerated code ;The fast shutdown sequence doesn't free each allocated block, but lets ;the Zend Engine Memory Manager do the work. opcache.fast_shutdown=1 ;Enables the OPcache for the CLI version of PHP. opcache.enable_cli=1 </code></pre> <p>If you use any library or code that uses code annotations you must enable save comments:</p> <pre><code>opcache.save_comments=1 </code></pre> <blockquote> <p>If disabled, all PHPDoc comments are dropped from the code to reduce the size of the optimized code. Disabling "Doc Comments" may break some existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload