How to Install PHP with Apache

In this tutorial, we will show you how to install PHP with apache. This step by step guide will guide you on how to download the initial setup file to complete installation.
Step 1 – Open Php for Windows website
Before we teach you how to install php with apache, we need to download the setup file first.
In order to do so, open up any browser and log on to “”. Once the webpage loads, move to the download section.
Go to Php for Windows website

Step 2 – Download the application
Over here, scroll down and move to the archives section. Now you will need to download the application according to your system. Since we are running a 32 bit operating system here, we will search for and download the “php-5.3.5-win32-VC6-x86.msi” file.
Download the application as per your system

Step 3 – Continue with the Installation Wizard
Once the download has been completed, simply double click on it to open up the installation wizard.
With that done, the installation wizard splash screen will appear. Simply click on Next to continue with the process.
Next, you will need to agree to the terms in the license agreement. Once done, you can move on to the next step.
Proceed with the installation wizard

Step 4 – Set installation path
Over here, you will need to set the path for the installation. Over here, we will simply keep the path “C: \PHP” and move on to the next step.
Change installation path

Step 5 – Select Web Server
Next, you will need to select the web server. Over here, we will select the Apache 2.2 x Module to continue installing php with apache.
Select Apache as your Web Server

Step 6 – Set server path
Now we will be required to set the path for the server. Over here, let’s keep it simple and define the path as “C :\Apache\conf\” in order to proceed installing php with apache.
Define server path

Step 7 – Install PHP
With that done, simply click on install in the next step and the installation will continue automatically.
Installing PHP

Step 8 – Work with the configuration file
Once the installation has been completed, we will load the PHP module for Apache 2.x server. In order to do that, access the conf directory and open up the “httpd.conf” file using Notepad.
At the bottom of the configuration file, find the text PHPIniDir “”. In the middle of those quotes, type the location where you have installed php. For example in this case, it will be “C :\PHP”.
In the next line notice that no path is defined for the “php5apache2_2.dll” file. Over here, we will add the same path as we did before; so before the filename, add the path “C :\PHP\ ” and save the changes made.
Modify the configuration file

Step 9 – Restart Apache
Now let’s use the shortcut key “windows+ r” to open up the run command. Over here, type services.msc to open up the services window. Move to the pane towards the right side of the screen and double click on Apache to restart the service. This is so that the changes made earlier can take effect.
Restart Apache to apply new changes

Step 10 – Create server file
With that done, move to the htdocs directory and over here create a new text file named “phpinfo.txt”. Open up the file and type:

Make a server file

Step 11 – Save the php info file
With that done, save the file as phpinfo.php. This file will basically help you to easily view information about your server.
Saving the phpinfo file

Step 12 – View the php information
With that done, open up the browser, type “localhost/phpinfo.php” in the address bar above and hit enter. This page will show you all the information you need about the current PHP version installed.
View php information in your browser