Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Zend OPcache Extension + PHP >= 5.4 on Windows

Is it possible to install Zend OPcache module for PHP 5.4.29 in Windows Environment? I have downloaded OPCache that was meant to be compatible with PHP 5.4 but

php -v

does not show anything new loaded.

like image 593
Flasz Avatar asked Dec 09 '22 07:12

Flasz


1 Answers

Zend OPcache extension is compatible with 5.3.* 5.4.* and PHP 5.5.*

You should download the source-code of the extension and compile yourself or try to download pre-compiled windows version here and call the extension in your php.ini like this:

zend_extension=/path/to/opcache.dll

Notice :

  1. There are multiple versions exists for windows binaries: Thread Safe and Non-Thread Safe. You should pick the correct one according your needs. Learn more about TS and NTS here.
  2. Each build has a php version in filename. In your case, you should use php_opcache-7.X.X-5.4-XX-XX-XXX.zip.

Update Since opcache is a part of php core for a long time and this question is highly visible on search engines, I wanted to update my answer.

According to documentation, enabling opcache using following lines in php.ini:

zend_extension=php_opcache.dll
opcache.enable=On
opcache.enable_cli=On

then restarting the web server (IIS I guess) should be enough.

like image 77
edigu Avatar answered Dec 11 '22 12:12

edigu