0
votes

I am very Beginner to Drupal, And Currently I want to install 8.7.7 Drupal Version in My 7.2.19 Php version Xampp but During installation I got first Warning like

PHP OPCODE CACHING Not enabled PHP OPcode caching can improve your site's performance considerably. It is highly recommended to have OPcache installed on your server.

After that I added below code to Php.ini file

zend_extension="C:\xampp\php\ext\php_opcache.dll"
zend_extension=php_opcache.dll

Then I got other Fatal Error like,

Fatal error: Uncaught Error: Class 'Drupal\Component\Utility\OpCodeCache' not found in C:\xampp\htdocs\orange\core\install.php:37 Stack trace: #0 {main} thrown in C:\xampp\htdocs\orange\core\install.php on line 37

Can Anyone help me to solve this problem? Not working for me

zend_extension="C:\xampp\php\ext\php_opcache.dll"
zend_extension=php_opcache.dll

opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=256
opcache.max_accelerated_files=2000
1
Your version of PHP should have native OPCache. What happens if you remove both of the zend_extension lines? (Perhaps add opcache.save_comments=1 and opcache.load_comments=1.) Reference: drupal.org/docs/8/system-requirements/php-requirements#drupal-8Isaiah Nixon

1 Answers

0
votes

You might have missed the enable line before the zend stuff. Also, did you restart the web server? Try this

open a php.ini file

1   Change the ;opcache.enable=1 to opcache.enable=1

2   Add opcache dll path at the end of the file zend_extension = "C:\xampp\php\ext\php_opcache.dll"

3   Restart apache

Credits to : Windows, XAMPP, PHP 7 and opcache

Update: Maybe it’s using another php.ini file. 1) Try this to reveal the loaded file - use example 1 in link below.

https://www.php.net/manual/en/function.php-ini-loaded-file.php

2) Then see if opcache extensions are loaded by printing the file itself:

Put test.php somewhere in in you website with following content

<?php phpinfo();?>