How to Install PHP on Windows

Rodolfo Martins
2 min readMay 3, 2023

If you’re new to web development, you may be wondering how to get started with PHP on Windows. In this tutorial, we’ll show you how to install PHP on your Windows computer, so you can start building dynamic web applications.

Step 1: Downloading PHP

The first step is to download PHP from the official website at php.net/downloads.php. You’ll want to download the version that is compatible with your operating system (Windows) and architecture (32-bit or 64-bit).

Once you’ve downloaded the PHP archive, extract its contents to a directory on your computer, such as C:\php.

Step 2: Adding PHP to Your PATH

To make it easier to use PHP from the command line, you’ll want to add the directory where you installed PHP to your system’s PATH environment variable. To do this, follow these steps:

  1. Open the Start menu and search for “Environment Variables”.
  2. Click on “Edit the system environment variables”.
  3. Click on the “Environment Variables” button.
  4. In the “System Variables” section, scroll down until you find the “Path” variable and click on “Edit”.
  5. Click on “New” and enter the path to the directory where you installed PHP. For example, if you installed PHP in C:\php, you would enter C:\php in the "New" dialog box.
  6. Click “OK” to save your changes.

Step 3: Testing Your PHP Installation

Finally, test your PHP installation by opening a command prompt or terminal and running the following command:

php -v

This should display information about the version of PHP you have installed.

Conclusion

By following these steps, you can easily install PHP on your Windows computer and start building dynamic web applications. With this powerful tool at your disposal, you’ll be able to create powerful and scalable web applications in no time!

--

--