How to enable PHP OPcode caching for Drupal 8?
Asked Answered
L

7

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
Leahy answered 5/7, 2016 at 10:24 Comment(2)
What is your extension_dir value in your php.ini? and where does php_opcache.dll reside?Muffler
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.Ferrell
R
3

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.
Rigsdaler answered 1/4, 2022 at 17:28 Comment(0)
N
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

Nimiety answered 12/7, 2016 at 15:39 Comment(1)
And here is for localhost with XAMPP: drupal.org/node/2623566 . This one worked for me. Lubos @thank youArmentrout
R
3

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.
Rigsdaler answered 1/4, 2022 at 17:28 Comment(0)
T
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.

Toilsome answered 11/7, 2016 at 6:28 Comment(0)
T
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.

Tuinenga answered 6/11, 2016 at 10:43 Comment(0)
K
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
Karisa answered 14/12, 2016 at 18:14 Comment(0)
E
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

Etem answered 5/6, 2018 at 2:15 Comment(1)
Use formatting tools to make your post more readable. Code block should look like code block. Use bold italics if neededAtomizer
D
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.

Dowitcher answered 7/11, 2019 at 15:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.