Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable PHP OPcode caching for Drupal 8?

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
like image 624
Hello Universe Avatar asked Jul 05 '16 10:07

Hello Universe


People also ask

How do I enable PHP opcode caching?

Enabling opcode caching In the SOFTWARE section of the cPanel home screen, click Select PHP Version. Select the check box next to the opcode caching extension you want to enable: If you are using PHP version 5.4 or older, select apc. If you are using PHP version 5.5 or newer, select opcache.

What is opcode caching?

OPcache is a type of caching system that saves precompiled script bytecode in a server's memory called a cache, so each time a user visits a web page, it loads faster.

What is PHP opcode?

An OPCode is the numeric identifier of a single operation that can be performed by the Zend Virtual Machine (Zend VM). After PHP has scanned the human-readable source code and chunked it into tokens, these tokens are grouped together in the parsing phase.


2 Answers

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

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

like image 53
LubosMertak Avatar answered Sep 22 '22 22:09

LubosMertak


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.

like image 39
Ankur Kumar Singh Avatar answered Sep 25 '22 22:09

Ankur Kumar Singh