How to install APC/APCu cache on WAMP and XAMPP

In this tutorial, I will demonstrate How to install the PHP APC and APCu cache module on your PHP environment (WAMP/XAMPP). First, we will ensure about our version of APC cache which is based on compiler version. We will learn how to install PHP APC and APCu Cache on WAMP and XAMPP server in windows.

The APC is not compatible with php 5.5+ version, So I have Added steps to configure APCu which is supported by php 5.5+.

APC is a great op-code caching system for PHP that can help speed up your website. APC Cache helps to bypass the parsing and compiling steps and minimizes web request to the server.

Also checkout other tutorial of PHP Cache,

There are two type APC versions.

1- VC6
2- VC9

If your php compiler version is “Compiler: MSVC6 (Visual C++ 6.0)” ,Then we need to APC VC6 version Otherwise APC VC9 version.We will check compiler version from phpinfo file of wamp server.

Step 1 : We will download require version of php_apc.dll file from here
As per my compiler, I was downloaded ‘APC 3.1.6 for PHP 5.3 vc6’.

Step 2 : Let’s copy above dll file and paste into c: /wamp/bin/php/ext/ folder.

Step 3 : We will restart wamp or machine.

Step 4 : Enabled APC module from PHP Extension list.

Step 5 : Paste the below configuration parameter into C:\wamp\bin\apache\Apache2.2.17\bin\php.ini file

Step 6 : Restart the wamp server or Machine.

Step 7 : Open php info file of wamp server.
http://localhost/?phpinfo=1

If we will find APC module configuration into php info file then everything is OK and installed otherwise something is wrong.

How to Install PHP APC Cache on XAMPP

You can follow below steps to install PHP APC cache on XAMPP server. XAMPP is also commonly used by the developer for PHP development, So I am here to share steps to install APC php cache into xampp.

Step 1: Put the .dll(which you have downloaded from above step) file into php/ext folder.

Step 2: Open php.ini configuration file and find 'extension : php_apc.dll', if you not found then add this line otherwise remove the semi-colon before the extension.

Step 3: Restart the Xampp server check the phpinfo() and search APC if its found thats mean APC Successfully installed on your server.

How To Install APCu in PHP

I have configured APC on xampp/wampp, but APC is not supperted by php 5.5+ version. We will install APCu and configure which is compatible with php 5.5+.You can install APCu for wamp, xampp.

There are following steps to follow to configured APCu.
Step 1 : We will download require version of APCu file from here.
This page will have table with all available releases.

Step 2 : Let’s copy above dll file and paste into c:/wamp/bin/php/ext/ folder.

Step 3 : We will restart wamp or machine.

Step 4 : Enabled APC module from PHP Extension list.

Step 5 : Paste the below configuration parameter into C:\wamp\bin\apache\Apache2.2.17\bin\php.ini file

Step 6 : Restart the wamp server or Machine.

Step 7 : Open php info file of wamp server.
http://localhost/?phpinfo=1

Let’s check if apcu configuration table appears and apcu module is enabled, then everything is OK and installed otherwise something is wrong.

How To Clear APC Cache

We can clear the APC cache using php script. Let’s create apc_clear.php file and added below code into this file.Please make sure to replace xxx.xxx.xxx.xxx with your own machine IP address:

You can run your script directly at https://yourwebsite.com/apc_clear.php l clear out the APC cache for you.

Conclusion:

In this php apc cache tutorial, We have learned about the installation of PHP APC/APCu cache on WAMP and XAMPP server. I hope its help you and feel free to post your suggestions and questions into the comment section.