https://www.sitepoint.com/understanding-opcache/
As each PHP script is being compiled at runtime, a part of the execution time gets used for transforming the human readable code into code that can be understood by the machine. A bytecode cache engine like OpCache, APC or Xcache does it only once – during the first execution of a specific PHP file.
Installation
Click here to expand...
http://stackoverflow.com/questions/17224798/how-to-use-php-opcache
OpCache is compiled by default on PHP5.5+. However it is disabled by default. In order to start using OpCache in PHP5.5+ you will first have to enable it. To do this you would have to do the following.
Add the following line to your php.ini:
zend_extension=/full/path/to/opcache.so (nix)zend_extension=C:\path\to\php_opcache.dll (win)Note that when the path contains spaces you should wrap it in quotes:
zend_extension=“C:\Program Files\PHP5.5\ext\php_opcache.dll”Also note that you will have to use the zend_extension directive instead of the “normal” extension directive because it affects the actual Zend engine (i.e. the thing that runs PHP).
4 Functions
Click here to expand...
http://stackoverflow.com/questions/17224798/how-to-use-php-opcache
Currently there are four functions which you can use:
1. opcache_get_configuration():
Returns an array containing the currently used configuration OpCache uses. This includes all ini settings as well as version information and blacklisted files.
var_dump(opcache_get_configuration());2. opcache_get_status():
This will return an array with information about the current status of the cache. This information will include things like: the state the cache is in (enabled, restarting, full etc), the memory usage, hits, misses and some more useful information. It will also contain the cached scripts.
var_dump(opcache_get_status());3. opcache_reset():
Resets the entire cache. Meaning all possible cached scripts will be parsed again on the next visit.
opcache_reset();4. opcache_invalidate():
Invalidates a specific cached script. Meaning the script will be parsed again on the next visit.
opcache_invalidate(‘/path/to/script/to/invalidate.php’, true);