Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable OPCache not working in WAMP

Tags:

wamp

opcache

I tried to enable OPCache for Drupal 8.0.4 in WAMP 3 but it isn't working. So I googled and changed a few things in my php.ini file and here is what I changed:

opcache.enable=0

to

opcache.enable=1

and also

opcache.enable_cli=0

to

opcache.enable_cli=1

But still, the '!' mark appears near the PHP Extension. When I try to get the log it says :

Sorry,

The 'php_opcache' extension cannot be loaded by 'extension=php_opcache.dll' in php.ini. Must be loaded by 'zend_extension='.

Switch cancelled

Press ENTER to continue...

But in the PHP.ini file it says:

zend_extension ="C:/wamp/bin/php/php7.0.0/ext/php_opcache.dll"

What else should I do to enable OPCache?

like image 462
Hello Man Avatar asked Feb 23 '16 07:02

Hello Man


People also ask

How do I enable Opcache?

OPcache can only be compiled as a shared extension. If you have disabled the building of default extensions with --disable-all, you must compile PHP with the --enable-opcache option for OPcache to be available. Once compiled, you can use the zend_extension configuration directive to load the OPcache extension into PHP.

Should I disable Opcache?

The entire purpose of PHP's opcache is to speed up your scripts and save CPU by storing compiled PHP scripts in memory. If you'd rather have slower apps and increased CPU usage to save memory, you can disable the opcache.


1 Answers

Go to PHP configuration / php.ini file and add these two lines end of the page

zend_extension=php_opcache.dll

; Determines if Zend OPCache is enabled

opcache.enable=1

You can also increase the max execution time on php.ini configuration file.

max_execution_time=180

Hope it helps.

like image 87
Jack Avatar answered Sep 20 '22 07:09

Jack