How to Install/Update PHP on Windows?

Posted in /  

How to Install/Update PHP on Windows?

Sangeeta Gulia
Last updated on January 11, 2023

    Server-side programming has become quintessential programming in today’s world, with the increasing use of websites and web applications. It is a technique used in web development that involves running scripts on a web server and producing a response to each user’s request. The language used to create scripts that run on the web server is called a server-side scripting language.

    PHP (recursive acronym for PHP: Hypertext Preprocessor) is a general-purpose server-side scripting language. It is widely used in web development. Web developers use PHP in conjunction with HTML.

    It will be a good choice for someone who is a beginner in the server-side programming area and has started learning this language for web development.

    The following are the features of PHP:

    1. Generate dynamic web pages on the server.
    2. Send and receive cookies.
    3. Create sessions.
    4. Encrypt data.
    5. Connect to databases.
    6. Receive data from forms.

    So, if you are interested in learning PHP and want to install or update it on your Windows system, this is the right article for you.

    Here, I will walk you through the essential steps to install/update PHP on Windows.

    How to Install/Update PHP on Windows?

    Before you install PHP on Windows, you need to meet the following prerequisites.


    1. PHP requires Windows 2008/Vista or later.
    2. PHP does not run on Windows RT/WOA/ARM.
    3. In PHP 7.2.0, Windows 2008 and Vista are not supported.
    4. It requires the Visual C runtime.
    5. The Microsoft Visual C++ Redistributable for Visual Studio 2019 for all these PHP versions is available here .

    Install PHP/Update PHP

    Follow the below steps to install and update PHP on your Windows system.

    Step 1

    Visit the official website of PHP , and go to the downloads section.

    Download section

    Step 2

    Click on Windows Downloads .

    Download for Windows

    Step 3

    Download the latest zip file.

    Download the latest zip file

    Step 4

    Unzip the file, and you’ll get one extracted folder.

    Copy the folder and paste it into the Program Files (c:\Program Files) folder in your system.

    Step 5

    Go inside the folder which you have recently pasted into Program files and copy the address.

    Program files

    Step 6

    Click the Start menu and search “ System Variables ”. Click “ Edit the system environment variables ” → “ Environment Variables ”.

    Environment Variables

    Step 7

    Go to the “ Path ” option and double-click on it.


    Step 8

    Click on the “ New ” button and paste the address copied in Step 5. Click OK .

    new environment variable

    Step 9

    Close all the open windows by saving the changes. Now open the Command Prompt and test if the PHP is working in your system.

    Enter the following command to test. If the version shows up in the command prompt, it means that PHP has been installed successfully.

    php -v

    Check PHP version

    Update PHP Using Chocolatey

    If you want to upgrade PHP through Chocolatey , you can use the following command.

    It will upgrade all the associated libraries and packages, and it will save all the manual effort.

    choco upgrade php

    Update PHP

    The complete successful installation will look like this. A screenshot after upgrading PHP is attached below.


    It is very simple to install/update PHP on Windows, as you can see in the aforementioned steps. There are two ways to update PHP – manually and through the Chocolately package manager.

    I hope the above steps have helped you successfully install and update PHP on your Windows system. If you still face any problems, let us know in the comment section below. We will be happy to help.

    Thank you for reading this article!

    People are also reading:

    Leave a Comment on this Post