{"id":1496,"date":"2014-12-30T01:38:32","date_gmt":"2014-12-30T01:38:32","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=1496"},"modified":"2014-12-30T01:38:32","modified_gmt":"2014-12-30T01:38:32","slug":"opcache-php-5-5","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/12\/30\/opcache-php-5-5\/","title":{"rendered":"opcache in php 5.5"},"content":{"rendered":"<p>Installation<br \/>\nOpCache 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.<\/p>\n<p>Add the following line to your php.ini:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# zend_extension=\/full\/path\/to\/opcache.so (nix)\n# zend_extension=C:\\path\\to\\php_opcache.dll (win)\n\n<\/pre>\n<p>Note that when the path contains spaces you should wrap it in quotes:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# zend_extension=&quot;C:\\Program Files\\PHP5.5\\ext\\php_opcache.dll&quot;\n\n<\/pre>\n<p>Also note that you will have to use the zend_extension directive instead of the &#8220;normal&#8221; extension directive because it affects the actual Zend engine (i.e. the thing that runs PHP).<\/p>\n<p>Usage<br \/>\nCurrently there are four functions which you can use:<\/p>\n<p>opcache_get_configuration():<\/p>\n<p>Returns an array containing the currently used configuration OpCache uses. This includes all ini settings as well as version information and blacklisted files.<\/p>\n<p>var_dump(opcache_get_configuration());<br \/>\nopcache_get_status():<\/p>\n<p>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.<\/p>\n<p>var_dump(opcache_get_status());<br \/>\nopcache_reset():<\/p>\n<p>Resets the entire cache. Meaning all possible cached scripts will be parsed again on the next visit.<\/p>\n<p>opcache_reset();<br \/>\nopcache_invalidate():<\/p>\n<p>Invalidates a specific cached script. Meaning the script will be parsed again on the next visit.<\/p>\n<p>opcache_invalidate(&#8216;\/path\/to\/script\/to\/invalidate.php&#8217;, true);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installation 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 &#8230; <a title=\"opcache in php 5.5\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/12\/30\/opcache-php-5-5\/\" aria-label=\"Read more about opcache in php 5.5\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84],"tags":[],"class_list":["post-1496","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=1496"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1496\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=1496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=1496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=1496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}