PHP 5.5 introduced OPCache, a code caching module, enhancing performance. However, its documentation may be scarce.
Enabled by default on PHP5.5 , OPCache requires configuration. 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)
Retrieving Configuration and Status
var_dump(opcache_get_configuration()); var_dump(opcache_get_status());
Resetting and Invalidating Cache
opcache_reset(); opcache_invalidate('/path/to/script/to/invalidate.php', true);
OpCacheGUI
Features:
opcache-status
Features:
opcache-gui
Features:
The above is the detailed content of How to Enable and Utilize PHP OPCache for Performance Boost?. For more information, please follow other related articles on the PHP Chinese website!