Upgrade PHP version in WAMP

One can easily upgrade PHP version in WAMP manually. WAMP allows you to have multiple versions of php and you can choose any one of them to be used.

Following are the steps to be followed for upgrading php version in WAMP.

  1. Download version of PHP for Windows.
  2. Extract and place the folder in wamp/bin/php/
  3. Give the folder name according to downloaded version
  4. Copy 3 important files from existing version of php and paste them into new PHP version folder.
  5. Open php.ini file and correct the version of PHP where required

 

1. Download version of PHP for windows

Zip file of PHP version can be downloaded from PHP version for Windows. Download thread safe version.

 

2. Extract and place the folder in wamp/bin/php/

Extract the downloaded zip file of php version and place that into wamp/bin/php/ folder.

 

3. Give the folder name according to downloaded version

Now rename the folder and give it the name according to the downloaded version of PHP. For example, If you have downloaded PHP version 5.6.13 so give it a name php5.6.13

 

4. Copy 3 important files from existing version of PHP and paste them into new PHP version folder

The 3 important files to be copied from existing PHP version to new folder are:

  1. php.ini
  2. phpForApache
  3. wampserver.conf

 

5. Open php.ini file and correct the version of PHP where required

You need to change the php version in php.ini file. For example, extension_dir needs to be changed. If php.ini was copied from php5.4.3 so you will have to change extension_dir path from c:/wamp/bin/php/php5.4.3/ext/ to c:/wamp/bin/php/php5.6.13/ext/. Also find this sort of change if required within php.ini file and update them.

 

Now new version is ready to be used. Exit the WAMP and open it again. Stop all services and select the PHP version from PHP version menu as show below. Now Restart All Services.

upgrade-php-version-wamp

 

To verify the version of PHP running on your local server, open localhost in web browser and then click on phpinfo.

phpinfo