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.
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 :
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.
In addition to @edigu's answer, here are some additional considerations for Windows Server 2012R2/IIS 8+ users. PHP version is 7.2. I'm using the old Codeplex version of PHP Manager, so perhaps these steps don't apply if you're using the recently revamped version.
php_opcache.dll
in the extensions GUI doesn't work. In php.ini, find the line that says extension=php_opcache.dll
rename it to zend_extension=php_opcache.dll
.opcache.
and make sure it isn't commented out.On
and Off
values for toggling properties, such as in opcache.enable=On
, you can also use 1
and 0
respectively.Restart the site in IIS, then the Zend OPcache section on the phpinfo() screen should report everything up and running.