In this post, I’ll be outlining the steps to get a fully functional PHP IDE setup. I’ll be using the Ubuntu Linux way of installing stuff, but you can replace it with any repository or online location as needed. First things first, the ingredients: Sun Java 6, Eclipse Europa 3.3, Eclipse PDT. I’m using the latest version of Ubuntu at the time of writing: Ubuntu 8.04 LTS Hardy Heron.
Get the JDK: in Ubuntu, the latest version can be obtained by
apt-get install sun-java6-jdk
which installs the Sun version from the Sun Java website. If you already have GCJ (the GNU JDK), better replace it with this. Installing Java from the Ubuntu repository instead of downloading it manually from Sun means that you don’t have to muck about creating symlinks to Java and the likes – everything’s done for you. Next, install Eclipse. Eclipse is available as a Ubuntu package, but since Hardy Heron contains version 3.2 (not 3.3, which is required for the latest version of PDT) of Eclipse, lets resort to a manual install. What’s more, Eclipse Europa 3.3 bundled with the PHP Development Tools (PDT) can be obtained from the PDT site, so this is what we’ll do. Visit the Eclipse PDT download page. Select the download version you need (1.0.3 in my case), which will take you to the next page. Select the PDT All-in-One package for your platform: Linux, Windows or Mac OS. Download the relevant package and unzip/untar it somewhere. In Linux, I’d do:
tar -xvzf pdt-all-in-one-R20080603-linux-gtk.tar.gz
Which would create the Eclipse directory in the specified location. Go into the Eclipse folder and assign the correct permissions to the executable eclipse file under the Eclipse folder:
chmod 777 eclipse
And then run Eclipse by:
Alternatively, you can add a launcher/shortcut to the panel pointing to this so that Eclipse can be executed with a click of the mouse. Eclipse should be up and running now, with full PDT support. PDT provides error-detection, project builds, and debugging support amongst others.
Eclipse PDT contains many features useful for PHP development, including the much needed PHP debugging support. I’ll touch upon this in my next post. Enjoy Eclipse 🙂