{"id":99,"date":"2017-02-21T12:53:06","date_gmt":"2017-02-21T01:53:06","guid":{"rendered":"https:\/\/www.aspireweb.com.au\/blog\/?p=99"},"modified":"2017-02-21T14:51:16","modified_gmt":"2017-02-21T03:51:16","slug":"how-to-enable-php-opcache-on-windows-iis-and-wamp","status":"publish","type":"post","link":"https:\/\/aspireweb.com.au\/blog\/how-to-enable-php-opcache-on-windows-iis-and-wamp\/","title":{"rendered":"How to enable PHP OPcache on Windows IIS and WAMP"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-115 alignright\" src=\"https:\/\/www.aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/zendopcache_header.png\" alt=\"\" width=\"250\" height=\"175\" srcset=\"https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/zendopcache_header.png 250w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/zendopcache_header-128x90.png 128w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/>If your running PHP on Windows and using PHP 5.5+ including PHP 7+ the Zend OPcache comes built in by default but isn&#8217;t enabled.<\/p>\n<p>You will get massive improvements on any sequential execution of a PHP pages and there is really no reason not to use the Zend OPcache.<\/p>\n<p>&nbsp;<\/p>\n<p>So lets enable the PHP OPcache and gain a whole lot of PHP speed!<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ol>\n<li>Open your PHP.INI file in a text editor like notepad. Depending how you installed PHP with could be in your program files under the php version but it could be easier to just find it.<\/li>\n<li>Check that the extension directory is configured by making sure that &#8220;extension_dir&#8221; has been set. Typically this line should read:\u00a0extension_dir = &#8220;ext&#8221;<\/li>\n<li>Go the the end of the PHP and on a new line add:\u00a0zend_extension=php_opcache.dll<\/li>\n<li>Restart IIS or Apache<\/li>\n<li>Enjoy faster PHP<\/li>\n<\/ol>\n<p>You may want to confirm that the above has worked and the easiest way to do this is by <a href=\"https:\/\/www.aspireweb.com.au\/blog\/how-do-i-create-a-phpinfo-page\/\">creating a PHPInfo file<\/a> and confirming that &#8220;with Zend OPcache&#8221; is shown under the Zend Engine line.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-102\" src=\"https:\/\/www.aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124731_PM.jpg\" alt=\"\" width=\"940\" height=\"66\" srcset=\"https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124731_PM.jpg 940w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124731_PM-300x21.jpg 300w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124731_PM-768x54.jpg 768w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124731_PM-128x9.jpg 128w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p>\n<p>And further down the page\u00a0the &#8220;Zend OPcache&#8221;\u00a0section should now exist and show that it&#8217;s &#8220;Up and Running&#8221; like below:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-101\" src=\"https:\/\/www.aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124046_PM.jpg\" alt=\"\" width=\"951\" height=\"75\" srcset=\"https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124046_PM.jpg 951w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124046_PM-300x24.jpg 300w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124046_PM-768x61.jpg 768w, https:\/\/aspireweb.com.au\/blog\/wp-content\/uploads\/2017\/02\/Screenshot_022117_124046_PM-128x10.jpg 128w\" sizes=\"auto, (max-width: 951px) 100vw, 951px\" \/><\/p>\n<p>There are also lots of other good stats shown, as you refresh the cached pages this section (after a refresh) will show stats on how well the OPcache is working.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If your running PHP on Windows and using PHP 5.5+ including PHP 7+ the Zend OPcache comes built in by default but isn&#8217;t enabled. You will get massive improvements on any sequential execution of a PHP pages and there is really no reason not to use the Zend OPcache. &nbsp; So lets enable the PHP [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-iis","category-php"],"_links":{"self":[{"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":12,"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":122,"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions\/122"}],"wp:attachment":[{"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aspireweb.com.au\/blog\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}