How To Enable PHP OPCache In Localhost Running XAMPP On Windows? - Techubber

How to enable PHP OPCache in localhost running XAMPP on Windows?

Categories: , ,

Like & Share:

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 enable

PHP 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:

opcache.enable=1
opcache.memory_consumption=64
opcache.max_wasted_percentage=5
opcache.use_cwd=1

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.
Advertisement

 

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
#Enable PHP OPCache in XAMPP

Related Posts

Like & Share:
Previous

Selfie stick not working with Android Phone? Check these settings on the phone

XAMPP – MySQL Service detected with wrong path – running multiple MySQL on same computer

Next

Leave a Comment (FB)

Leave a comment