Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By juanaboy on
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
Did you try Google?
https://www.google.com/search?q=php%20opcode%20cache&rct=j
Lol..
Lol..
Tried that. I understand what it is, just not how to incorporate it into Drupal.
I'm not very smart...just trying.
if you have opcache set up it
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.
Thanks for the reply....
Thanks for the reply....
I'm still a little confused on how and were to install opcode...bit of newbie.
Sorry...
What am I looking for in the
What am I looking for in the phpinfo documentation through the status report?
Think I'm getting closer...I
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.
Lol...this is what I have
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...
Correct config
You should put your config under [php] not under [opcache]
http://php.net/manual/en/opcache.installation.php#118436
How to install depends on the
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
I'm using Windows 7 with
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...
xampp may be a little
xampp may be a little different.
Try: zend_extension=php_opcache.dll
https://commaster.net/content/installing-php-fastcgi-and-zend-opcache-xa...
Thanks for the link...
Thanks for the link...
No luck though. I must be missing something stupid.
I'll keep at it...
Note that you may need to
Note that you may need to restart the server before the changes will come into effect.
use zend for windows
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.
worked PHP 7.2
and Drupal 8.6.5
Fix OSX XAMPP
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
Correct Solution is below
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.