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

Windows 11 24H2: A Guide to New Features and Rollout

Upgrading to Windows 11 version 24H2 brings numerous benefits, including performance boosts, important security patches,…

2 days ago

DeepSeek R1: A Game-Changing AI Model That Challenges Industry Giants

DeepSeek is an AI firm located in Hangzhou, China, founded in May 2023 by Liang…

5 days ago

RAN Virtualization: The Complexity of Fully Implementing

In the context of 5G networks and beyond, radio access network (RAN) virtualization is a…

5 days ago

Experience Zero Trust Network Access (ZTNA)

Zero Trust Network Access (ZTNA) has emerged as a cornerstone of robust cybersecurity strategies in…

1 week ago

Installing Ubuntu 22.04 LTS on Windows 11 Using VirtualBox

Installing Ubuntu on a Windows operating system can be a great way to explore Linux…

1 week ago

Operator by OpenAI: Your Personal AI for Everyday Tasks

2025 is rapidly becoming the "Year of the AI Agent," with leading tech companies like…

2 weeks ago