---
title: "PHP Installation on Windows"  
description: "Installing PHP on Windows 7 is quite simple. Before installing PHP into your computer you need to have web server running in your computer. Here I pre"  
author: "Anonymous User"  
published: 2011-08-31  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/711/php-installation-on-windows  
category: "php"  
tags: ["php"]  
reading_time: 4 minutes  

---

# PHP Installation on Windows

Installing PHP on Windows 7 is quite simple. Before installing PHP into [your computer](https://www.mindstick.com/articles/13023/choosing-the-best-power-cord-for-your-computer-a-layman-s-guide) you need to have [web server](https://www.mindstick.com/articles/23199/digital-personal-server-the-premium-web-server) running in your computer. Here I preferred to use ‘Apache’ web server for this demonstration. Click here to download Apache web server.

Though I am on a 64 bit Windows 7 [operating system](https://answers.mindstick.com/qa/114592/which-mobile-operating-system-is-better-for-privacy-ios-or-android), I downloaded Thread safe php-5.3.8-Win32-VC9-x86.zip file (A Thread Safe version should be used if you install PHP as an Apache module whereas Non Thread Safe version should be used if you install PHP as a CGI binary). This article will describe you, how to install PHP files in your computer.

Step 1: First Create a directory where you want to install PHP file. Here I preferred to use C drive to install PHP files. Now create a folder with name php in c drive and extract downloaded php zip file into this folder.

Step 2: Now open c:\php folder, you will see php.ini-recommended file, copy this file and paste in same directory with name php.ini. If php.ini-recommended file is not found (In the case of higher version) then you will see two file with name php.ini-[development](https://yourviews.mindstick.com/view/83465/china-s-development-near-indian-border-and-how-it-is-a-threat-to-india) and php.ini-[production](https://www.mindstick.com/news/2276/by-the-end-of-2023-tesla-cybertruck-mass-production-will-begin), copy php.ini-development and paste in same directory with new name php.ini.

##### Let’s have some snapshot of PHP file.

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/7779a34b-eaaf-4a81-8811-f12901e3014c.png)

Now extract PHP zip file into creating directory path ‘c: \php’

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/83d0fa55-a9ec-45b0-9600-68b40b3d9560.png)

Before proceeding next step of PHP [installation](https://www.mindstick.com/articles/198846/guidelines-for-proper-fiber-optic-cable-installation) let’s we have some snapshot for installing ‘Apache’ web server. You can see here, how to install Apache web server in windows 7 operating system.

Step 3: Configure Apache Web Server 2.2 for PHP installation

Now configure Apache web server for PHP installation. Though you have been able to put PHP on your computer, it's still not "installed" in the true sense of the word. We have to configure Apache web server to communicate with PHP. This is done by editing the Apache [configuration file](https://www.mindstick.com/forum/155707/what-is-the-usage-of-asp-dot-net-configuration-file) which is ‘httpd.conf’.

Step 3(a):

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/be219873-0357-4743-8d4e-e8fbcc83ceee.png)

The ‘httpd.conf’ file will be appear as

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/77e3795e-7e27-486d-b6f9-5438910ce17a.png)

Step 3(b):: Now locate the ‘LoadModule’ in file ‘httpd.conf’ and write the following line of code

## LoadModule php5_module “C:/php/php5apache2_2.dll”

**Note:** You can use ‘ctrl+F’ for search in ‘httpd.conf’ file.

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/7849f581-3167-47f0-b913-326fbb07f10f.png)

Step 3(c):: Locate AddType in file ‘httpd.conf’ and write the following code of line.

## AddType application/x-httpd-php

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/50d4d40e-2a3f-462b-85ae-dc4972f46e7a.png)

Note: Here you can specify other php [file extension](https://www.mindstick.com/forum/23173/getting-a-mime-type-from-a-file-extension-in-asp-dot-net-4-5) such as php3, .php4 etc..

Step 3(d): Move to the end of httpd.conf file and add the below line of code

## PHPIniDir “c:/php”

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/e4617782-3412-4a31-9389-89bd02ecef56.png)

Note: PHPIniDir “C:/php” tells the Apache web server the location of the PHP configuration file - php.ini.

When we have installed Apache web server, there is ‘htdocs’ directory available where you can put your php file. When you load http://localhost, Apache checks the htdocs folder – displays "It works” message, if php installation successfully completed. File that's displayed first time you test Apache installation is actually the index.html

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/17a2c48a-8740-4194-a57a-31910326f07c.png)\
Here I am creating a directory with name MySiteFile, and put all php file into this directory.

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/88b2f0f2-89b1-4980-baa3-46b140c37896.png)

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/d03703f6-7355-401d-99bc-bb413df214a8.png)

Now we have to test whether PHP was properly installed or not on Windows 7. So start Apache Server and type http://localhost:85/ (85 is a port no) in web address of browser. If PHP installed successfully then it show ‘It Works!’ (By default message) and if not then display an error message.

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/b03e6f20-7375-4a36-a2e1-72ec80513cca.png)

If you type http://localhost:85/MysiteFile then your php file will be displayed.

![PHP Installation on Windows](https://www.mindstick.com/mindstickarticle/cff0cf79-c5d2-483d-bbc5-a387a977c8d6/images/48c57d54-fa6f-43c3-a1d3-d6ada67de7a6.png)

\

---

Original Source: https://www.mindstick.com/articles/711/php-installation-on-windows

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
