<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="opcache.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 &reftitle.install;

 <para>
  OPcache can only be compiled as a shared extension. If you have
  disabled the building of default extensions with
  <option role="configure">--disable-all</option>, you must compile PHP with
  the <option role="configure">--enable-opcache</option> option for OPcache
  to be available.
 </para>
 
 <para>
  Once compiled, you can use the
  <link linkend="ini.zend-extension">zend_extension</link> configuration
  directive to load the OPcache extension into PHP. This can be done with
  <literal>zend_extension=/full/path/to/opcache.so</literal> on non-Windows
  platforms, and <literal>zend_extension=C:\path\to\php_opcache.dll</literal>
  on Windows.
 </para>

 <note>
  <para>
   If you want to use OPcache with
   <link xlink:href="&url.xdebug;">Xdebug</link>, you must load OPcache before
   Xdebug.
  </para>
 </note>

 <sect2 xml:id="opcache.installation.recommended">
  <title>Recommended php.ini settings</title>

  <para>
   The following settings are generally recommended as providing good
   performance:
  </para>

  <informalexample>
   <programlisting>
<![CDATA[
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
]]>
   </programlisting>
  </informalexample>

  <para>
   You may also want to consider disabling
   <link linkend="ini.opcache.save-comments">opcache.save_comments</link>
   and enabling
   <link linkend="ini.opcache.enable-file-override">opcache.enable_file_override</link>,
   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.
  </para>

  <para>
   On Windows, <link linkend="ini.opcache.file-cache-fallback">opcache.file_cache_fallback</link>
   should be enabled, and <link linkend="ini.opcache.file-cache">opcache.file_cache</link>
   should be set to an already existing and writable directory.
  </para>

  <para>
   A full list of configuration directives supported by OPcache
   <link linkend="opcache.configuration">is also available</link>.
  </para>
 </sect2>
</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
-->
