Skip to content

How to install PHP on Windows manual?

  • by
  • 4 min read

PHP has far been the preferred language for programming web backends. It’s supported by most if not all local webserver packages as well. 

If you decide to download and install a local web server stack like WAMP or XAMPP, PHP will be installed locally alongside it. However, if for whatever reason you need to install PHP manually, here’s how.

Also read: How to install Java on Windows 10?

Installing PHP on Windows 10

Now while there’s an installer available on the official PHP website, we suggest that you install it manually as it’s more stable and avoids running into any conflicts if in case you have any webservers installed on your PC.

Step 1: First up, we need to download the zip file for the latest PHP release. At the time of writing this article, the latest release is 7.4.11

How to install PHP on Windows manual? | Candid.Technology
You can download PHP from here

Step 2: Once you’ve downloaded the zip package, extract it in the root directory of your C:/ drive in a folder called PHP7

How to install PHP on Windows manual? | Candid.Technology

Step 3: Go inside the PHP7 folder you just created and look for a file called php.ini-development. Copy and paste this file in the same directory and rename it to php.ini. 

How to install PHP on Windows manual? | Candid.Technology

Step 4: We’re now going to make some configuration changes in the php.ini file. Note that the entire file is written in the form of comments which means there’s a ‘;’ preceding each line. You’re going to have to remove it wherever applicable. Open it in notepad and make the following changes

  • Define the extension directory: Look for the line extension_dir and change it to extension_dir = “C:/PHP7/ext”
How to install PHP on Windows manual? | Candid.Technology
  • Enable extensions: Although this will depend on the libraries you end up using, these should cover all the basics
    extension=curl
    extension=gd2
    extension=mbstring
    extension=mysql
    extension=pdo_mysql
    extension=xmlrpc
How to install PHP on Windows manual? | Candid.Technology
  • Configure the mail() method: If you’re looking to use the PHP mail() function to send emails, You can configure it with whatever server SMTP settings you prefer.
How to install PHP on Windows manual? | Candid.Technology

Step 5: Now we’re going to add a path variable for our PHP installation so we can access it from the command prompt. To do so, open the Start menu and type in ‘environmental variables’. 

How to install PHP on Windows manual? | Candid.Technology

Under the Advanced tab, click on Environment Variables.

How to install PHP on Windows manual? | Candid.Technology

Step 6: Under System Variables, click on Path and then Edit.

How to install PHP on Windows manual? | Candid.Technology

Step 7: Click on the New button. Then type in C:\PHP7 and then click OK.

How to install PHP on Windows manual? | Candid.Technology

And that’s about it. You’ve installed PHP on your system. You might need to restart it at this point for all the changes to take effect. 

As a sanity check, fire up the Command Prompt and type in php-v to check the PHP version. You should see something like this.

How to install PHP on Windows manual? | Candid.Technology

Also read: How to install Python on Windows?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: yadullahabidi@pm.me.

>