7

I want to enable PHP OPcode caching for Drupal 8 installation. I have the following in Xampp php.ini. However, I still get opcode not enabled. What am I doing wrong??

opcache.enable=1

engine = On
zend_extension=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
Hello Universe
  • 3,248
  • 7
  • 50
  • 86
  • What is your `extension_dir` value in your `php.ini`? and where does `php_opcache.dll` reside? – revo Jul 10 '16 at 16:06
  • Is there an error message regarding the `zend_extension=php_opcache.dll` line in the error logs? If not, it is likely that the extension was loaded correctly. – BurninLeo Jul 14 '16 at 07:25

7 Answers7

4

Here is nice post about OPCache: How to use PHP OPCache?

And here is for localhost with XAMPP: https://www.drupal.org/node/2623566

Community
  • 1
  • 1
  • And here is for localhost with XAMPP: https://www.drupal.org/node/2623566 . This one worked for me. Lubos @thank you – Kodali444 Dec 25 '19 at 17:20
2

First of all check your PHP version. Before and after PHP 5.5 things are little bit different. You may refer for difference here http://php.net/manual/en/opcache.installation.php

Also if you are using zend extension then full path of dll is required in below

zend_extension=/your/path/tod/dll/php_opcache.dll

Also make sure to use correct one in terms of threaded or non threaded version.

2

Hello Universe see if this helps :-

  • Try to use zend_extension=opcache instead of zend_extension=php_opcache.dll as the former has been deprecated in PHP major version. Check your php.ini file for more details.
  • Check if zend.assertions! are enabled.
  • I would recommend to go through Opcache issue solved! , which is working fine for most of the cases.
  • Restart your Apache.
1

Open php.ini file. There You have to uncomment this line of code: zend_extension=opcache.so . After that restart lampp/xampp. It works for me.

alyn
  • 11
  • 1
0

change your php.ini config:

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
Ibrahim Haouari
  • 240
  • 3
  • 11
0
[opcache] zend_extension=php_opcache.dll 
;Determines if Zend OPCache in enabled 
opcache.enable=1 
opcache.memory_consumption=128 
opcache.interned_strings_buffer=8 
opcache.max_accelerated_files=4000 
opcache.revalidate_freq=60 
opcache.fast_shutdown=1

Paste this link in php.ini

siva k
  • 1
  • 1
  • Use formatting tools to make your post more readable. Code block should look like `code block`. Use **bold** *italics* if needed – Morse Jun 05 '18 at 02:25
0

For Mac Users Go in /Application/XAMPP/etc/php.ini line no.

Change this

;zend_extension=opcache.so

to (remove ;)

zend_extension=opcache.so

Save the file php.ini and restart the server.

Anup
  • 169
  • 8