<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/opcache.setup.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'opcache.installation.php',
    1 => 'Installation',
    2 => 'Installation',
  ),
  'up' => 
  array (
    0 => 'opcache.setup.php',
    1 => 'Installing/Configuring',
  ),
  'prev' => 
  array (
    0 => 'opcache.setup.php',
    1 => 'Installing/Configuring',
  ),
  'next' => 
  array (
    0 => 'opcache.configuration.php',
    1 => 'Runtime Configuration',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/opcache/configure.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="opcache.installation" class="sect1">
 <h2 class="title">Installation</h2>

 <p class="simpara">
  OPcache can only be compiled as a shared extension. If you have
  disabled the building of default extensions with
  <strong class="option configure">--disable-all</strong>, you must compile PHP with
  the <strong class="option configure">--enable-opcache</strong> option for OPcache
  to be available.
 </p>

 <p class="simpara">
  Once compiled, you can use the
  <a href="ini.core.php#ini.zend-extension" class="link">zend_extension</a> configuration
  directive to load the OPcache extension into PHP. This can be done with
  <code class="literal">zend_extension=/full/path/to/opcache.so</code> on non-Windows
  platforms, and <code class="literal">zend_extension=C:\path\to\php_opcache.dll</code>
  on Windows.
 </p>

 <blockquote class="note"><p><strong class="note">Note</strong>: 
  <span class="simpara">
   If you want to use OPcache with
   <a href="http://xdebug.org/" class="link external">&raquo;&nbsp;Xdebug</a>, you must load OPcache before
   Xdebug.
  </span>
 </p></blockquote>

 <div class="sect2" id="opcache.installation.recommended">
  <h3 class="title">Recommended php.ini settings</h3>

  <p class="simpara">
   The following settings are generally recommended as providing good
   performance:
  </p>

  <div class="informalexample">
   <div class="example-contents">
<div class="cdata"><pre>
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1 ; prior to PHP 7.2.0
opcache.enable_cli=1
</pre></div>
   </div>

  </div>

  <p class="simpara">
   You may also want to consider disabling
   <a href="opcache.configuration.php#ini.opcache.save-comments" class="link">opcache.save_comments</a>
   and enabling
   <a href="opcache.configuration.php#ini.opcache.enable-file-override" class="link">opcache.enable_file_override</a>,
   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.
  </p>

  <p class="simpara">
   On Windows, <a href="opcache.configuration.php#ini.opcache.file-cache-fallback" class="link">opcache.file_cache_fallback</a>
   should be enabled, and <a href="opcache.configuration.php#ini.opcache.file-cache" class="link">opcache.file_cache</a>
   should be set to an already existing and writable directory.
  </p>

  <p class="simpara">
   A full list of configuration directives supported by OPcache
   <a href="opcache.configuration.php" class="link">is also available</a>.
  </p>
 </div>
</div><?php manual_footer($setup); ?>