update
Guide
1

How to Update PHP in WAMP

In this article, we will show you how to update PHP in WAMP or add new PHP version. Before getting into it, we will first give a brief introduction on WampServer.

Introduction

WampServer is one of the most popular web development environment tool for Windows. It allows you to create web applications with Apache2, PHP and a MySQL or MariaDB database. Also, it contains PhpMyAdmin that allows you to manage your database easily with an interface.

Though it contains up-to-date version for most applications, but it is only during the new release of WAMP. As time goes by, there will be newer versions for PHP and WampServer won’t able to keep up to it. In this article, we will show you how to update PHP in WAMP or add new version by downloading PHP from it’s official website and other steps.

Step 1 – Download PHP

We will need to download the latest PHP version from the PHP website. By visiting https://www.php.net/downloads.php you will see a list of PHP version and depending on which PHP version you wish to upgrade, choose “Windows Downloads“.

update php

Under the Windows downloads page, download the ZIP file under “VS16 x64 Thread Safe” section. x64 refers to 64-bit and most modern computers will be able to support it.

What’s the difference between Thread Safe and Non-Thread Safe?

TS or Thread Safe refers to multithread capable builds. NTS or Non-Thread Safe refers to single thread only builds. Use case for TS binaries involves interaction with a multithreaded SAPI and PHP loaded as a module into a web server. For NTS binaries the widespread use case is interaction with a web server through the FastCGI protocol, utilizing no multithreading (but also for example CLI).

Step 2 – Extract the ZIP file

After downloading the ZIP file, extract all of its content to a new folder under WAMP’s PHP folder, in most cases it should be located here “C:\wamp64\bin\php“.

In this tutorial, we will create a new folder call “php8.2.0” under “C:\wamp64\bin\php” and extract the ZIP file into that new folder. Example screenshot below.

extract php to wamp

Step 3 – Copy the Previous Files

When you download the new PHP zip file, the php.ini and phpForApache.ini file is missing. This is because we will need to rename the file “php.ini-production” to “php.ini” and make changes in the file content.

To save time and hassle, we can actually simply copy the files over from our previous PHP version. Here, we are copying the 3 files “php.ini“, “phpForApache.ini” and “wampserver.conf” files from “C:\wamp64\bin\php\php8.1.0” folder.

copy php.ini file

The “wampserver.conf” file is needed as well so that the WampServer is able to detect the new PHP folder that we just created.

Step 4 – Modifying Configuration Files

After we have copied over those files “php.ini” and “phpForApache.ini“, we will need to modify certain part of the file content. Simply, use any text editing software to open up those files. Here, we will be using notepad++, which you can download it from here https://notepad-plus-plus.org/downloads/

Open both of those files and search for the previous version

Update PHP in Wamp

Replace the old version number to the new version which is “8.2.0”. You will need to find and replace all of them for both of those files.

Also, you will need to copy the zend_ext folder from your old PHP folder into the new PHP folder. And if you are upgrading your PHP version to a major one, for example, from 8.1.0 to 8.2.0, you will need to download the Xdebug file from its website here https://xdebug.org/download#releases

Update PHP in Wamp

But if you are updating your PHP version for example from PHP 8.1.0 to 8.1.6, you will only need to copy the folder over and change the folder name in the php.ini and phpForApache.ini file just like the screenshot above.

Step 5 – The Last Step to Update PHP in WAMP

After you have modified the configuration files, you will need to restart your WampServer in order for it to detect the new PHP version or folder that you’ve just download.

Right-click your WampServer icon under your taskbar and click “Refresh“.

restart wamp

You WampServer icon color should now change, wait until it becomes green and then Left-click the WampServer icon again. Go to PHP > Version and click “8.2.0”

new php version

Now, your WampServer should be running the latest PHP version that you just download and installed.

And now you have successfully update your PHP in WAMP when the WampServer icon has turned green!

Additional – Update PHP in WAMP

Also, remember to add or edit your PHP path on your system so that when you are running “Composer” or when you are running the “php” command, it should use the latest version of PHP. For example below

PHP path

Go to “system properties” under the advance tab, click “Environment Variables“. Then under “System Variables“, double click “path” and then change the previous PHP path from \php\php8.1.6 to \php\php8.2.0.

Side Note – Update PHP in WAMP

Now that we know how to update or add new PHP version in WAMP using this guide. If you want to upgrade your phpMyAdmin application in WAMP as well, you may follow this guide here https://www.kintechie.com/how-to-update-phpmyadmin-in-wamp/

One thought on “How to Update PHP in WAMP

Comments are closed.