j adams wrote on 05/03/2015 16:12:
I don't know if this is a question for the documentation team or not, but
figured I'd start here. There does not appear to be any definitive, clear,
reliable information on PHP's op caching functionality in recent 5.*
versions and this problem needs to be remedied.
Question 1: Is OpCache enabled by default in php 5.5 and later or not?
This page:
http://php.net/manual/en/intro.opcache.php
says "This extension is bundled with PHP 5.5.0 and later, and is ยป
available in PECL for PHP versions 5.2, 5.3 and 5.4."
But this page:
http://php.net/manual/en/opcache.installation.php
says "PHP 5.5.0 and later
OPcache can only be compiled as a shared extension. If you have disabled
the building of default extensions with --disable-all , you must compile
PHP with the --enable-opcache option for OPcache to be available.
Once compiled, you can use the zend_extension configuration directive to
load the OPcache extension into PHP. This can be done with
zend_extension=/full/path/to/opcache.so on non-Windows platforms, and
zend_extension=C:\path\to\php_opcache.dll on Windows."
Question 2:
If OpCache is enabled, does it require any php.ini settings or not? Does it
show any functions or constants or phpinfo() that will reveal its
existence? I've got php 5.6.6 installed on CentOS 7 and I can find neither
hide nor hair of it. There is, however, an opcache package one can install
(php56u-opcache.x86_64 in my case).
Question 3:
What about Zend Optimizer? Still other articles say it has been integrated
into php 5.5 and later, but this mythical beast also makes no sign to
indicate its inclusion either. Some articles:
https://wiki.php.net/rfc/optimizerplus
https://wordpress.org/support/topic/looking-ahead-to-php-55-zend-optimizer-the-end-of-apc
http://www.internetnews.com/blog/skerner/php-5-5-to-include-open-source-zend-optimizer-.html
Seems to me there is currently a lot of confusion surrounding OPCache and
it should be cleared up.
I think part of your confusion here is over terminology:
- Every module of PHP is referred to as an "extension", however deeply
embedded it is in the language. The most basic functions you can think
of, like string and array manipulation, are in "ext/standard" in the source.
- A module being "bundled" means that it is included in the official
tarball releases on php.net, and indicates a certain guarantee of
maintenance for compatibility with new versions of PHP.
- Some bundled extensions cannot be disabled, because to do so would
break too many dependencies. Most can technically be disabled, and/or
built as separate shared libraries to be enabled in your php.ini as
desired. In the case of OpCache, it's bundled, but as a shared library.
- The PHP you install on a Linux system will most likely NOT be the
official tarball, but something put together by your Linux distribution.
They are under no obligation to handle all bundled extensions the same
way, or enable them by default. They may for instance install the
extensions as shared libraries and offer a script to enable/disable
them, or they may put them all into separate packages which you have to
install and then configure themselves automatically.
- Oh, and roughly speaking "OpCache" is the name for the open sourced
version of "ZendOptimizer+", i.e. the version which was made available
as a PECL download for PHP 5.2, 5.3, and 5.4, and included as a
"bundled" extension in PHP 5.5 onwards.
This is all a rather long-winded way of saying the same thing Rasmus
just said, but maybe it will help. :)
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php