How to upgrade from PHP 4.x to PHP 5.x on Windows

How to upgrade from PHP 4.x to PHP 5.x on Windows
This tutorial walks you through step by step and shows how you can upgrade from PHP 4.x to PHP 5.x on a Windows machine running IIS 4.x or higher.

If you already have PHP 4.x installed on your IIS server, make sure you uninstall it before upgrading to PHP 5.x. The best way to uninstall PHP 4.x is to go to the Control Panel > Add Remove Program > and select PHP 4.x and click on Uninstall. Because I have already uninstalled PHP 4.x therefore I don’t have any image to show you.

Download PHP 5.x from

On this page click on PHP 5.x.x zip package under Windows Binaries.

After downloading the .zip file, unzip it. I unzipped all the contents to C:\PHP

Now go to Control Panel > Administrative Tools > Internet Information Services and you will see something like this:

Right click on Default Web Site and select Properties. When the new window opens up, select the Home Directory tab and click on Configuration… to open the Application Configuration window.

In the Application Configuration window select the Mappings tab and click Add. Fill in the information as shown in the following image and click OK:

In the end, your Application Window should have the .php extension and the executable path to the directory where php-cgi.exe resides. It should look something like this:

Since this is an upgrade, therefore I am still using my old PHP.INI file.

Click on OK, close all windows and restart IIS server.

Test Your Installation:

Time to test if PHP is working or not!

After restarting your web-server, create a page in the wwwroot directory and name it test.php

Put the following code in test.php

Now open your web browser and type in the address bar. You should see the following information on PHP:

If this page comes up, you are ready to start coding in PHP, but if you have any problems then check the permissions on the C:\PHP folder and make sure that IUSR_xx has execute permissions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top