When installing Drupal 9 in Windows OS on XAMPP, we get a warning to enable PHP OPCache . In this post, we will see how to enable PHP OPCode Caching on localhost running XAMPP. The exact error message is reproduced below.
PHP OPcode caching
Not enablePHP OPcode caching can improve your site's performance considerably. It is highly recommended to have OPcache installed on your server.
Enable PHP OPCache on Windows XAMPP
If your XAMPP comes with PHP 5.5+, opcache is already included in the bundle by default. So, you just need to enable it.
- Open php.ini (located at: C:\xampp\php\php.ini).
- Add this line at the end of the php.ini file:
zend_extension = “C:\xampp\php\ext\php_opcache.dll”
- On the same php.ini file, remove the ‘;' from the following settings:
- Finally, restart Apache.
Enable OPCache in XAMPP in Mac OS X
To enable PHP OPCODE Caching for XAMPP running on Mac OS X, do the following
- Open php.ini (located in /Applications/XAMPP/xamppfiles/etc/.
- Find the line “zend_extension=opcache.so” in the php.ini file and uncomment the line.
- And restart Apache.
That's all. You have enabled PHP OPCache on your computer by following the steps above. Restart Apache. And you may continue to install Drupal.
#How to enable PHP OPCache in Windows 10
#Enable PHP OPCache in XAMPP