How to install PHP 8.4.3 on Windows 11?

Installing PHP on Windows 11 can seem troublesome, especially if you’re new to programming or web development. However, with the right guidance, you can set up the latest version of PHP quickly and easily. In this article, we’ll walk you through the steps of installing PHP 8.4.3 on Windows 11 and running your first PHP program. Let’s dive in!

Why Install PHP?

PHP (Hypertext Preprocessor) is a popular server-side scripting language widely used for web development. Its flexibility and ease of use make it suitable for developing dynamic web applications. The latest version, PHP 8.4.3, offers performance improvements and new features that enhance coding efficiency and security.

By installing PHP, you can:

  • Create dynamic web pages.
  • Connect to databases.
  • Utilize various programming libraries and frameworks.

Read More: Installing Ubuntu 22.04 LTS on Windows 11 Using VirtualBox

Step-by-Step Guide to Install PHP 8.4.3 on Windows 11

Step 1: Download PHP

  1. Open your preferred web browser and search for “PHP” in your search engine. Navigate to the official PHP website.
  2. Once on the PHP homepage, click on the Downloads section.
  1. Locate the Windows Downloads option. Choose the link for the current version, which is 8.4.3 in this case.
  1. You will see two versions available: Non-Thread Safe and Thread Safe. We recommend selecting the Thread Safe version. This version is suitable for use with web servers such as Apache and Nginx.
  1. Click on the appropriate zip file to start downloading.

Step 2: Extract the Downloaded File

  1. Once the download is complete, navigate to the folder where the zip file was saved.
  2. Right-click on the zip file, select Extract All and specify the folder name as PHP 8.4.3.
  1. Click Extract to unzip the files.

Step 3: Move PHP to Program Files

  1. After extracting, right-click on the PHP folder you just created and select Cut.
  2. Navigate to the C: drive and open the Program Files folder.
  3. Right-click in the directory and select Paste. You may need to click Continue to authorize this action.

Step 4: Set Up Environment Variables

To run PHP from the command line, you need to add it to your system’s environment variables:

  1. Open the Start Menu and type “environment variables.” Click on Edit the system environment variables.
  1. In the System Properties window, click on the Advanced tab and then on Environment Variables.
  1. Find the Path variable in the System variables section and select Edit.
  1. Click on New and paste the path to your PHP installation (e.g., C:\Program Files\PHP 8.4.3).
  1. Click OK to save your changes.

Step 5: Verify the Installation

  1. Open the Command Prompt (you can search for “CMD” in the Start Menu).
  2. Type the following command and hit Enter:

    PHP -- version
  3. If PHP was installed correctly, you should see the version 8.4.3 displayed.

Step 6: Create Your First PHP Program

Now that PHP is successfully installed, let’s write your first PHP script:

  1. Go to any drive, for instance, the D: drive, and create a new folder.
  2. Inside this folder, right-click and create a new text document. Name it indnex.php.
  1. Right-click on index.php and choose to open it with Notepad or Notepad++.
  1. Add the following code to your PHP file:

    <?php
    echo ‘Zarnab’;

    ?>
  2. Save the file and close the editor.

Step 7: Run Your PHP Script

  1. Right-click and select “Open in terminal
  1. When the terminal opens, type the following command and press enter.
    PS D:\Zarnab> dir

    Only file be visible index.php. Now to run it type

    php index.php
  2. If everything is set up correctly, you should see “Zarnab” printed in the terminal. Congratulations! You have just installed PHP and run your first program.

Also Read: How to Install VirtualBox on Windows 11

Conclusion

Successfully installing PHP 8.4.3 on Windows 11 provides a solid foundation for web development projects. By following the steps outlined in this guide, you can efficiently set up your development environment and leverage the performance enhancements and new features offered by this latest PHP version.

Zarnab Latif

Zarnab Latif is a versatile technical writer with a passion for demystifying the complexities of Artificial Intelligence (AI). She excels at creating clear, concise and user-friendly content that helps developers, engineers, and non-technical stakeholders understand and effectively utilize AI technologies.

Recent Posts

Top Tech Conferences in March 2025

Success in the tech industry requires continuous learning, networking and staying updated with the latest…

5 days ago

Hackers Exploit VMware: Three Critical Zero-Days Found

Broadcom issued a warning today regarding three newly discovered VMware zero-day vulnerabilities (CVE-2025-22224, CVE-2025-22225, and…

5 days ago

Microsoft Unveils Dragon Copilot to Revolutionize Clinical Workflows with AI Voice Assistant for Healthcare

Microsoft has announced Dragon Copilot to revolutionize clinical workflows with AI voice assistant for healthcare.…

6 days ago

11 Emerging Trends in Multi-Cloud and Hybrid Cloud Strategies for 2025

Cloud computing continues to evolve, and businesses increasingly adopt multi-cloud and hybrid cloud strategies to…

7 days ago

Top 32 Linux Interview Questions and Answers

Every technology era brings new developments and breakthroughs, and Linux is no exception. Linux is…

1 week ago

Building a Robust Digital Infrastructure: The Role of SASE in Today’s Networking Landscape

Gartner introduced SASE, or Secure Access Service Edge, to revolutionize networking by integrating connectivity and…

1 week ago