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?

Multiple PHP versions on Wampserver

Multiple PHP versions on Wampserver

 

 

 

 

 

 

 

 

UPDATE (20/09/2014) : Remember to download the Thread Safe version of PHP. Here’s a brief explanation on what’s the difference.

 

 

Advertisements

Leave a comment.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s