Before you start
Are you a PHP developer? If so, then what do you use as your development environment? Maybe you're a minimalist who likes to engage in vi vs. Emacs debates. Or maybe you prefer an IDE, but haven't been impressed with the commercial offerings available. Either way, you'll want to take a look at the PHP Development Toolkit for Eclipse. That's right — Eclipse. It's not just for Java developers anymore. A background in PHP programming is essential for getting the most out of this tutorial. Familiarity with the Eclipse IDE is helpful, but not necessary. For some background information about Eclipse, see Resources.
In this "Web development with Eclipse Europa" series, you'll see how no matter what your language of choice is, Eclipse is the platform for Web development. Its flexible plug-in system makes it easy to create versions of Eclipse customized for Web development with Java technology, PHP, and Ruby. You'll see how different plug-ins give Eclipse unique capabilities for each language. You'll also see some of the common features that all Web developers can take advantage of. Throughout this series, we will be creating a sample baseball Web application, which will allow us to enter in game data for baseball players and calculate statistics for those players.
Eclipse has been a favorite IDE for Java developers for many years. However, Eclipse was designed to be a development platform for any language. Eclipse is written in the Java programming language, so, naturally, Java development was an obvious starting point for it. Eclipse's plug-in architecture has led to a bounty of powerful plug-ins and has been key in the success of Eclipse. Taking these two facts together — Eclipse's strength as a development platform for any language and Eclipse's plug-in architecture — and you have the ingredients for an Eclipse-based IDE for PHP. That's exactly what has happened with the development of the PHP Development Toolkit.
This is Part 2 of a three-part tutorial series on developing Web applications with Eclipse. So far, we've seen how easy it is to develop Web applications in the Java language using the Eclipse IDE for Java EE Developers. The Java EE edition is really just a collection of plug-ins running on the Eclipse Platform. In this tutorial, we'll see how to develop PHP applications using a different set of Eclipse plug-ins, collectively known as the PHP Development Toolkit (PDT). We'll also see a reprise of some features in the Java EE Edition that are also part of the PDT.
A background in Java programming is essential for getting the most out of this tutorial. Familiarity with the Eclipse IDE is helpful, but not necessary.
You'll need the following installed on your computer:
- Eclipse Europa
- This tutorial uses Eclipse V3.3 (Europa).
- Java Development Kit (JDK)
- This tutorial shows you how to develop Web applications using Java technology, so you'll need the Java Development Kit (JDK) 5.0 or higher. Download V5.0 or V6.0.
- Eclipse IDE for Java EE Developers
- You'll also need the Eclipse IDE for Java EE Developers.
- Java Runtime Environment (JRE)
- To run Eclipse, you must have a JRE.
- Apache Tomcat
- The application uses a Apache Tomcat as its container.
- MySQL V5.0
- The application uses MySQL V5.0 as its database.
- Java Persistence API
- You will also need the Java Persistence API and, in particular, the OpenJPA implementation.
- Eclipse PHP Development Toolkit (PDT)
- This tutorial shows you how to develop Web applications using PHP, so you'll need the PHP Development Toolkit You can get this as a set of plug-ins for an existing Eclipse installation. If you're new to Eclipse, you can get an all-in-one installation that includes the Eclipse platform and the PDT plug-ins.
- You need PHP, so get the latest version, which at the time of this writing was V5.2.1.
- Apache HTTP Server
- You need a Web server that integrates with PHP. This tutorial was developed using Apache V2.0.59.
- Fancy PHP debugger
- You need a PHP debugger. We used the Zend Debugger V5.2.10.
- Operating system
- You need an operating system capable of running all of the above. We used Mac OS X when creating this series, but you can use a modern version of Windows® or Linux®, as well. Adjust locations of files accordingly.