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.

Nathan Pakovskie is an esteemed senior developer and educator in the tech community, best known for his contributions to With a passion for coding and a knack for simplifying complex tech concepts, Nathan has authored several popular tutorials on C# programming, ranging from basic operations to advanced coding techniques. His articles, often characterized by clarity and precision, serve as invaluable resources for both novice and experienced programmers. Beyond his technical expertise, Nathan is an advocate for continuous learning and enjoys exploring emerging technologies in AI and software development. When he’s not coding or writing, Nathan engages in mentoring upcoming developers, emphasizing the importance of both technical skills and creative problem-solving in the ever-evolving world of technology. Specialties: C# Programming, Technical Writing, Software Development, AI Technologies, Educational Outreach

Leave a Reply

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

Back To Top