Jan.24

How to set up Multiple PHP versions on Wampserver

Having an easy way to switch PHP version is indeed a neat feature. Wampserver makes it easy for developers (like me!!) who works on Windows. Here’s how.

First if you haven’t update your WAMP installation for a while here’s a chance to do it. Keep a backup of your configuration files and your database, then remove WAMP from Programs and Features. Download the latest WAMP and install it. Then restore you backups. Now you should have the latest build of Apache/PHP/Mysql.

But you also need a previous version of PHP. What about it? Well it’s easy. Download the version you need from here. Create a folder under [WAMP_FOLDER]/bin/php/ with the name ‘php’ and the version you have just downloaded and extract the contents of the zip file there. There it should have another folder which is the current PHP version of WAMP.

Now we need a last thing for the WAMP server to recognize this install. Copy from the default PHP version’s folder three files:

  • php.ini
  • phpForApache.ini
  • wampserver.conf

and paste them on the folder you have just created. Change the ‘extension_dir’ setting from the first two files and open the third and make any appropriate changes.

Terminate WAMP and run it again, not just restart it’s services. And there you have it. Multiple PHP versions in just a click. Sweet right?