Please Help!

I have just started using Drupal, and now have gone from 7 to 8. I am having problems with the PHP OPcode caching. When I run the status report, all is fine except for this:

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

I can't find any simple explanation or tutorials on how to install this, or for that matter, correct this error.

Please help!

Thanks.

Comments

juanaboy’s picture

Lol..

Tried that. I understand what it is, just not how to incorporate it into Drupal.

I'm not very smart...just trying.

taslett’s picture

if you have opcache set up it should start using automatically.
You may not notice any difference.
Have a look for opcache values in the a phpinfo page you can get to it under admin/reports/status and look for PHP (more information)
Once it is running it compiles commonly used php files and function into opcode so they can run quicker.

juanaboy’s picture

Thanks for the reply....

I'm still a little confused on how and were to install opcode...bit of newbie.

Sorry...

juanaboy’s picture

What am I looking for in the phpinfo documentation through the status report?

juanaboy’s picture

Think I'm getting closer...I found the opcache options at the end of the php.ini file. Does this mean it is installed, just not enabled?

Thanks again.

juanaboy’s picture

Lol...this is what I have added to php.ini:

[opcache]

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

; Determines if Zend OPCache is enabled
opcache.enable=On

; The OPcache shared memory storage size.
opcache.memory_consumption=512

Just guessing now...

intfrr’s picture

You should put your config under [php] not under [opcache]

http://php.net/manual/en/opcache.installation.php#118436

taslett’s picture

How to install depends on the OS and version of PHP
zend_extension=/full/path/to/opcache.so on non-Windows platforms,
zend_extension=C:\path\to\php_opcache.dll on Windows.

For me on Ubuntu and with PHP 5.6.4 I have a separate opcache.ini file with:
zend_extension=opcache.so

juanaboy’s picture

I'm using Windows 7 with Xampp, and PHP 5.6.4...

I've tried to put the zend_extension into php.ini, and reset xampp, but not luck...

Real frustrating...

taslett’s picture

xampp may be a little different.
Try: zend_extension=php_opcache.dll
https://commaster.net/content/installing-php-fastcgi-and-zend-opcache-xa...

juanaboy’s picture

Thanks for the link...

No luck though. I must be missing something stupid.

I'll keep at it...

Jaypan’s picture

Note that you may need to restart the server before the changes will come into effect.

bw1drup’s picture

Had the same problem with a new Drupal 8 setup on Windows 7 with XAMPP 7.0.6.

Saw many different solutions.
Here is what worked for me.
Edit the PHP.ini file ( with XAMPP you can select from the XAMPP Control Panel Apache CONFIG button ).
Under [PHP] I searched "zend.enable_gc" line 336 on my version.
added code
zend_extension=C:\xampp\php\ext\php_opcache.dll

Works fine now.

lias’s picture

and Drupal 8.6.5

chris.lee’s picture

For those using XAMPP on OSX you can change the value in your php.ini file on line 1031 (or around there).

Just remove the comment the line by taking out the semicolon. Should look like the following.
zend_extension=opcache.so

anilpathariya’s picture

For those still searching this is correct solution

Here is what worked for me.
Edit the PHP.ini file ( with XAMPP you can select from the XAMPP Control Panel Apache CONFIG button ).
Under [PHP] I searched "zend.enable_gc" line 336 on my version.
added code
zend_extension=C:\xampp\php\ext\php_opcache.dll

Works fine now.