Installation Guide For Phpeclipse: Steps

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Installation Guide for PHPeclipse

Document Version 1.0

Introduction
Steps Install Eclipse 3.1 Install XAMPP Install Web Tools (WTP) Install PHPeclipse

Assumptions This document assumes that the reader is installing PHPEclipse on a system running Windows XP with at least 1 GB of RAM. The following product versions were used to prepare this document Windows XP with service pack 2 Eclipse 3.1 Build id: I20050627-1435 Sun Java JRE 1.4.2 release 9 Web Tools 0.7.0 XAMPP 1.4.15 PHPeclipse 1.1.7

Install Eclipse 3.1


Steps Download and install Eclipse Download and install a Java Runtime Environment (JRE) Run/Test Eclipse

Download and Install Eclipse


You can download the Eclipse installer from http://www.eclipse.org/downloads/index.php. Click on the link labeled Eclipse SDK 3.1 as shown below.

By default, the web site shows the most appropriate download for your system. If you need Eclipse for a different platform, click the link labeled Other downloads for 3.1. The download will arrive as a zip archive file. If you are running an operating system other than Windows XP, you may need software such as WinZip to extract the files from this archive. If you are running Windows XP, right-button click on this file and select Extract All.... Click Next > to move to the second page of the extraction wizard. On the second page, select a target location of C:\Program Files as shown below.

Click Next > to begin the extraction. This will create an eclipse directory that contains almost everything you'll need to run Eclipse.

Download and install a Java Runtime Environment


You system may already be configured to run Java in which case you can skip this step. The list of fully

supported (i.e. tested) JREs along with links to download them is linked from the Eclipse download page as shown below.

You can download the Sun Java 1.4.2 JRE from http://java.sun.com/j2se/1.4.2/download.html. There are several choices on this page. Select Download J2SE JRE as shown below.

You could alternatively download the JDK; however, this is intended more for software developers (from an Eclipse developer's point of view, the only reason you might download the SDK is to gain access to the J2SE source code). Follow the instructions to download the either the online or regular installer. If you choose to download the offline installer only a small file will be downloaded at first; when you start the installation process, the installer will download the remaining required files. In either case (whether you use the online installer or the regular one), the rest of the steps are basically the same (except that the online installer requires Internet access during the installation process). Accept all the defaults. Eclipse is ready to go!

Test/Run Eclipse
Locate and double-click on the Eclipse icon in the c:\program files\eclipse directory. A dialog will appear asking for the location of the workspace. Set the location to c:\program files\eclipse\workspace and click Ok. After a few seconds, the Eclipse workbench should appear.

You can make a shortcut for Eclipse (to make it easier to start) by right-clicking on the eclipse.exe icon in the file manager and selecting Create Shortcut from the menu. Drag the shortcut to a convenient location such as the desktop or the start menu.

Install XAMPP
XAMPP is a one-stop testing environment for PHP applications (it's actually a lot more than that, but this definition should suffice for now). You can download XAMPP from http://www.apachefriends.org/en/xampp-windows.html. There are three different ways to download XAMPP: use the ZIP download (this is done mainly out of paranoia. With the ZIP, we know exactly what gets extracted and where; the automated installers may add entries to the registry or hide files in other locations). Right-button click on the downloaded file and select Extract All.... Extract the archive to C:\ (the root directory of your C drive). You can test XAMPP by opening a command prompt, navigating to the c:\xampp directory and executing the command xampp_start. The output of this command is shown below.

As the output suggests, you can use xampp_stop to stop the processes. Unfortunately, we need to configure XAMPP to work properly. Specifically, we need to tell the Apache Web Server, where to find your PHP files. Open the file named c:\xampp\apache\config\http.conf. Locate the line that starts with the word DocumentRoot and change it to the following: DocumentRoot "c:\program files\eclipse\workspace"

Install Web Tools (WTP)


The PHPeclipse feature requires that WTP be installed. From the Help menu, select Software Updates > Find and Install.... In the dialog box, select Search for new features to install and click Next >. Put a check mark next to Eclipse.org update site and click Finish. If an Update Site Mirrors dialog box opens, accept the default update site by clicking OK. Put a check mark beside the WTP 0.7 and click Select Required. Then click Next >.

Carefully read through the license agreement and accept it (or alternatively don't accept it, click Cancel and find something else to do). Click Next >. Click Finish. Watch the pretty flashing lights for about a minute. When the Verification dialog box appears, click Install All. When the installation is complete, a dialog box will appear asking if you want to restart Eclipse. Click Yes.

Install PHPeclipse
Before you install PHPeclipse, you must install the WTP 0.7 feature as described in the previous section. From the Help menu, select Software Updates > Find and Install.... In the dialog box, select Search for new features to install and click Next >. Click New Remote Site... Fill in the resulting dialog box as shown below.

Click OK. Make sure that PHPeclipse has a check mark beside it (and that no other updates sites are checked) and click Finish. In the Updates dialog, put a check mark beside the PHPeclipse feature and click Next >. Carefully read and accept the license. Click Finish. When the Verification dialog box appears, click Install All. When the installation is complete, a dialog box will appear asking if you want to restart Eclipse. Click Yes.

After Eclipse restarts, you need to configure PHPeclipse. Open the preferences by selecting Preferences from the Window menu. Expand the PHPeclipse Web Development section and select the PHP External Tools entry. Configure the preferences page as shown below.

Running PHPeclipse
Open the PHP perspective. Notice the tool bar that's added with this perspective. The first icon starts the XAMPP environment; the second stops it. Status information during the start process will be displayed in the console view. With XAMPP started, you can edit PHP files and the output as shown below:

The PHP Browser view is updated when you open (or switch to) an editor on a PHP file, or you save.

Limitations and Issues


Project Location All projects must be defined in the workspace directory so that PHP files can be found by the Apache Web Server. You cannot create PHP projects in other parts of the file system. Security When you run XAMPP, you are starting a number of services on your workstation. The steps outlined in this document configure XAMPP to run only when you tell it to run (it can be configured to run automatically when the workstation starts). When XAMPP is running, a live web server that points to your project workspace is available to anybody that has network access to your machine. Anything that is defined in your workspace is potentially visible to snoopers. By default, the Apache Web Server is configured to disallow directory browsing which should reduce the risk (potential intruders will have to know what they're looking for). This is really only a potential issue in insecure locations like hotels with broadband connectivity.

One Workspace Only There are options that apparently could make this work with multiple workspaces. Unfortunately, I haven't been able to sort out how they work (if they work). For now, with this configuration, XAMPP only works with one project directory.

Glossary
Eclipse A kick-ass IDE and framework for building just about anything. IDE Integrated Development Environment. An IDE is an environment for building software that includes numerous tools including such things as text editors, compilers, debuggers, and execution environments. J2EE Java 2 Enterprise Edition. J2EE is a specification for building scalable enterprise applications that generally run on a server and deliver content to the user via a web browser (though it is not limited to this). The J2EE specification is itself an umbrella specification that includes Enterprise JavaBeans (EJB), Servlet, Java ServerPages (JSP), Java Database Connectivity (JDBC), Java Transaction API (JTA), and more. The next release of J2EE is renamed Java Platform, Enterprise Edition 5 (Java EE 5). J2SE Java 2 Standard Edition. J2SE is a collection of specifications, libraries, and tools for building Java applications. JDK Java Development Kit. The JDK is a collection of tools for building and running Java applications. The JDK includes a JRE. JRE Java Runtime Environment. The JRE is an execution environment for running Java applications. PHP (from Wikipedia) PHP is a popular open-source, reflective programming language used mainly for developing server-side applications and dynamic web content, and more recently, other software. Originally, PHP stood for "Personal Home Page". Today, the official meaning is the recursive acronym "PHP Hypertext Preprocessor". WTP Web Tools Project. This is an Eclipse project designed to provide framework elements and tools for delivering applications to the web. A primary focus of the WTP is to enable developers to build and deliver J2EE applications. XAMPP (From Apache Friends web site) XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.

You might also like