Dec 29, 2008

How to install and run PHP 5 with Apache 1.x on Windows

Step 1 : Download PHP 5 from following link
PHP 5 Download

Step 2: Download Apache 1.3.x from following link
Apache 1.3.x Download

Step 3 : Install Apache 1.3.x download by running the msi file.

Step 4: On Server Information screen enter the following information
  1. Network Domain : localhost
  2. Server Name : localhost
  3. Administrator Email Address : abc@abc.com
  4. Select for All Users, on Port 80 radio button




Step 5 : Select Typical radio button and click next to install Apache Http Server.

Step 6 : Install PHP by clicking on the php msi installer

Step 7 : Select Apache 1.3.x Module as radio button option





Step 8 : Specify the location of the PHP installation.

Basic installation is done by following steps from 1 to 8. Now Apache needs to be configured for using PHP 5.

Step 1 : Open httpd configuration file which can be found at
\\Apache Software Foundation\Apache\conf

Step 2 : Enter the following LoadModule statement after series of LoadModule statement as shown below

LoadModule php5_module "c:/php/php5apache.dll"





Step 3 : Enter the following AddType statement after series of AddType statements as shown below

AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml





Step 4 : Enter the following ScriptAlias after ScriptAlias statement as shown below
ScriptAlias /php/ "c:/PHP/"





Step 5 : Test PHP configuration

Create PHP file as follows

test.php


Place this file under \\Apache Software Foundation\Apache\htdocs directory.

Start the Apache server and place http://localhost/test.php in browser.

If screen with php info is displayed then it mean that configuration is successful else there is something wrong somewhere.

No comments:

Post a Comment