Bobcares

PHP Enable OPcache Windows | Essential steps

by | Jul 23, 2022

Enabling PHP OPcache in Windows is now much easier, and we can gain a significant amount of PHP speed.

In the course of providing Server management services, Bobcares responds to all inquiries, no matter how minor.

Let’s look at how our Support team configures PHP OPcache in Windows.

Enable PHP OPcache In Windows

The Zend OPcache is built-in by default when running PHP on Windows and using PHP 5.5+, including PHP 7+, but it isn’t turned on by default.

There is really no excuse not to use Zend OPcache because any sequential execution of a PHP page will result in enormous improvements.

How to activate PHP OPcache?

  1. Firstly, open our PHP.INI file in notepad or another text editor. It might be in the programme files under the PHP version depending on how PHP was installed, but it might be simpler to just find it.
  2. Then make sure extension dir is set to ensure that the extension directory is configured. This line should typically read: extension_dir = "ext"
  3. Add zend_extension=php_opcache.dll on a new line at the end of the PHP code.
  4. Then restart Apache or IIS
  5. Finally, PHP is now faster.

The simplest way to verify that the aforementioned has been successful is to create a PHPinfo file and check to see if “with Zend OPcache” is displayed under the Zend Engine line. Additionally, further down the page, the “Zend OPcache” section ought to be present and display “Up and Running” as shown below:

php enable opcache windows

Numerous other useful statistics are also displayed. As we refresh the cached pages, this section will display statistics on the performance of the OPcache.

How to enable PHP OPCache in XAMPP?

We just need to enable PHP OPCache, which is already bundled with XAMPP. So to enable the extension:

  1. First, launch Notepad++ and open the file : c:\xampp\php\php.ini
  2. Then near the extension section, add the following line: zend_extension=php_opcache.dll
  3. Finally, restart Apache.

[Looking for a solution to another query? We are just a click away.]

Conclusion

In conclusion, PHP by default includes Zend OPcache. The steps to enable PHP OPcache in Windows, which will speed up PHP, were described by our Support team.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.