Skip to main content
Jump to: navigation, search

Configuring Eclipse to Edit your Website

This document is a work in progress.

The runtime environment for [1] runs Apache HTTP Server and PHP 4.3.4. Previous instructions have detailed how to configure XAMPP for use as a unit test environment for Phoenix. Unfortunately, XAMPP runs PHP 5.0 and there are significant differences between PHP versions 4.3.4 and 5.0 which make reliable testing impossible.

Phoenix Test Runtime Environment for Windows XP Setup

This document takes you through the steps that you need to follow to configure your workstation to run an Apache runtime environment similar to the environment running the [2] website. This environment is similar to the production environment but is not exact. It includes a minimally configured Apache web server along with PHP 4.3.4. This environment does not include MySQL or any other services.

Download and Installation

Download Apache HTTP Server 2.2.2 (current version at the time of this writing). You can find it here. Follow the provided instructions to install the software. On Windows, you will be asked if you want to install Apache as a service. If you do so, it will start whenever your machine is started. It is not necessary to install Apache as a service.

All the steps in this document assume that Apache HTTP Server is installed in the default location. On Windows this is "C:\Program Files\Apache Software Foundation\Apache2.2".

Download PHP 4.3.4. You can find it here. Follow the provided instructions to install the software. These instructions assume that it is installed in "C:\php-4.3.4". Be sure to select the Apache HTTP Server when prompted during installation. Assuming that the installer software has not been updated, you will have to manually configure Apache HTTP Server to find PHP. These instructions are written to the PHP directory during the installation process.

Effectively, this should amount to including the following lines in your apache.conf file:

LoadModule php4_module "/php-4.3.4/php4apache2.dll"
PHPIniDir "/php-4.3.4"
AddType application/x-httpd-php .php .php4 .php3 .phtml


This document assumes that you have a project named "www" containing the website contents in your Eclipse workspace.

Step 1: Configure Apache. Open the "http.conf" file (located in C:\Program Files\Apache Software Foundation\Apache2.2\conf\http.conf). Scroll to the bottom and add the following section:

    DocumentRoot [workspace_location]\www
    ErrorLog logs/phoenix
    CustomLog logs/phoenix common

Be sure to replace [workspace_location] with the location of your Eclipse workspace. This setting assumes that you will keep all your Phoenix code in a project named "www" and directs the Apache HTTP server to find content there.

Save the file.

Step 2: Configure the host. The previous setting configures a virtual host on your workstation named ""; in this step, you need to configure your workstation to know about the host. Open your hosts file using your favourite text editor. On Windows, this file is likely located at c:\windows\system32\drivers\etc\hosts. Add the following line to this file:

Save the file.

This line tells Windows that when a browser makes a request to [3], that the local machine will handle it. Your configuration of Apache has ensured that all requests coming into that address on the default port (80) will be handled by Apache using documents found in your workspace.

Step 3: Start Apache. You can start Apache from the command line using the httpd.exe. Stop Apache by typing Ctrl-C at the command prompt that started Apache. You can also install Apache as a Windows service which will make it start automatically when the workstation starts up.

Back to the top