Home arrow Apache arrow Page 4 - Installing and Configuring Apache 2 on a Windows XP Machine

Getting PHP Working - Apache

Apache 2 represents quite a change from previous versions. If you have set up a previous version of Apache on a Windows XP PC, you will be interested in setting up the new version. Dan Wellman shows how to set up and configure Apache 2 on a Windows XP PC to give you a development environment that will allow you to test your PHP and other dynamic web technologies before taking them live.

  1. Installing and Configuring Apache 2 on a Windows XP Machine
  2. Getting Started
  3. Configuring
  4. Getting PHP Working
  5. Configuring MySql
By: Dan Wellman
Rating: starstarstarstarstar / 153
September 28, 2005

print this article



To get PHP working, just visit www.php.net and download the PHP 5.0.4 installer.  Run the installer and keep all of the defaults.  Thatís it; PHP is installed as a CGI application.  All you need to do now is tell Apache that PHP is there.  Open the httpd.conf file from the start menu and find the DirectoryIndex directive again.  Add Index.php before index.html, because youíll want the server to look for an index.php file before it looks for any other file type.

Now scroll down to the ScriptAlias directive and add the following line of code below the existing directive:

ScriptAlias /php/ "c:/php/"

The path is the path to the default PHP folder, which is generated during the installation of PHP.  Change it if you chose to install to a different location.  Next youíll need to scroll quite a way down until you come to the AddType directives and add the following line of code directly beneath the last one:

AddType application/x-httpd-php .php

This will register files ending with a PHP extension to the list of available media types.  Finally, scroll down to the Actions section.  This section is commented out completely, so just add the following directive to a new line below the comments.  Make sure there is not a hash symbol at the start of the line:

Action application/x-httpd-php "/php/php-cgi.exe"

This will tell Apache how to process the media type that youíve just registered.  Now save the httpd.conf file and restart Apache.  The customary way to test a PHP installation is to make use of the phpinfo() function, which displays information about PHP and your system.  In Notepad, type the following line of code, then save the file as index.php:


Open a browser instance and again type http://localhost.  You should now see the results of the phpinfo() function.  PHP has now been successfully installed and Apache configured correctly for its use.


>>> More Apache Articles          >>> More By Dan Wellman

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates


Dev Shed Tutorial Topics: