Tuesday, February 10, 2015

Installing PHP Accelerator ZendOpcahe on Apache 2.4 for Windows

It's Windows platform again and it's all about how to make it fast on running Apache server. It may be easier to find useful materials for Linux platform.

Supposing you are using XAMPP for Windows 1.8.x, you will feel curious about where ZendOpcache module is sitting. It's not there and you'll need to download it yourself.

Opcode caching is a good way to improve PHP performance as it takes out the compiling time of PHP source code for each consecutive loading after the first time that piece of PHP script is loaded and served.

Here're the steps:

1. Please download the package (version as of today is 7.0.4) via the following link:
http://windows.php.net/downloads/pecl/releases/opcache/7.0.4/php_opcache-7.0.4-5.4-ts-vc9-x86.zip

2. Stop Apache Service.

3. Download and extract the library file “php_opcache.dll” and copy it into the directory “C:\xampp\php\ext\”.

4. Add the following lines (marked in red) to the end of PHP configuration file:

.
.
.
C:\xampp\php\php.ini

 …

 ; ; set in php ini file only

 ; ; make sure it's readable (open_basedir is checked) by coverage viewer script

 ; xcache.coveragedump_directory = ""

 ; ;; END OF XCACHE CONFIG



 [Zend_Opcache]

 zend_extension = "C:\xampp\php\ext\php_opcache.dll"

 opcache.memory_consumption=128

 opcache.interned_strings_buffer=8

 opcache.max_accelerated_files=4000

 opcache.revalidate_freq=60

 opcache.fast_shutdown=1

 opcache.enable_cli=1

.
.
.

5. Start Apache service.

6. Examine and check if the libraries are loading properly via http://localhost/xampp/phpinfo.php


6 comments:

  1. Good Post! , it was so good to read and useful to improve my knowledge as an updated one, keep blogging. After seeing your article I want to say that also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
    SAP Online Training

    ReplyDelete
  2. Nice blog to read, Thanks for sharing this valuable article.

    Best Big Data Hadoop Online Training

    ReplyDelete
  3. much obliged because of the reality you have been exact natured to rate assessment resulting to us. we can constantly perceive all you have completed here since I comprehend you are chosen stressed thoroughly considering our. Bitdefender Full Crack

    cyberspc.com

    ReplyDelete