Trying to crank out a bit more performance from WAMP? One simple way is to cache PHP. The most popular PHP caching plugin is APC (Alternative PHP Cache). The web is littered with posts on how to properly install APC on a Linux server, but I had a bit more trouble installing it properly on WAMP. Before we get started, you should note that APC is only available for PHP 5.3 and 5.4 versions. PHP 5.5 has its own caching mechanism, and APC is therefore not needed. Alright, with that in mind, let’s do this.
-
Download APC built for Windows for the version of PHP that you are running.
-
Copy the php_apc.dll file from your download in step 1 to the extensions directory in the PHP folder of your WAMP directory,
[path-to-wamp]/bin/php/php.#.#.#/ext
where [path-to-wamp] is the location that WAMP is installed on your machine and #.#.# corresponds to the version of PHP that you are running. -
Copy the apc.php file form your download in step 1 to the www directory in WAMP. The apc.php file includes monitoring and performance statics along with your APC configuration settings. It’s quite helpful when testing out different configurations of APC.
-
Completely exit and restart WAMP.
-
Enable the php_apc extension in WAMP. After enabling the APC extension, WAMP will automatically restart all services.
-
Open up your php.ini file from the WAMP menu, scroll to the bottom of the file and setup your APC configuration. Below is a screenshot of my APC configuration in WAMP.
-
Lastly, save your php.ini file and select the option to Restart All Services in WAMP. Give yourself a pat on the back, you have successfully installed APC for PHP on WAMP. Make sure to frequently check your apc.php monitoring page from step 3 at
[path-to-wamp]/www/apc.php
while you nail down your APC configuration.
Comments