Using PDT and Aptana Studio Harmoniously in Eclipse

By Sol in Know

I recently updated to the latest versions of Eclipse, PDT (PHP Development Tools), and Aptana Studio.  After a good deal of tweaking and some help from afar, I’ve got things working quite nicely.

The Conflict

After installing Eclipse 3.7 (Indigo) and PDT 3.0, I decided to go for the trifecta and installed Aptana Studio 3.  This latest version of Aptana Studio reintroduced PHP support (which is quite good), but lacked PDT’s immensely useful “Open Method” wizard.

Open Method Wizard

Just to rub salt in the wound, Aptana Studio 3 and PDT 3.0 don’t play nicely together, causing PDT to display an “Unsupported Content Type” error when opening PHP files.

Unsupported Content Type Error

Uninstalling Aptana Studio 3 resolved this issue.  Installing an earlier version of Aptana Studio also did not cause any errors so that was what I thought I was just going to have to live with.

A Ray of Hope

The folks at Aptana sent some information my way that pointed to a solution:

The solution

Using the information from the link they provided, I did the following to allow PDT 3.0 and Aptana Studio 3 to work in harmony with each other:

1. Remove Aptana’s PHP Nature from the Project

Via File > Properties > Project Natures with a project selected

Remove Aptana’s PHP Nature

Make sure that PDT’s PHP nature is still checked.

Note: the instructions provided by Aptana say to also remove the Web nature, but this is not necessary for working with PDT.

2. Set PDT as the default editor for PHP files

Go to: Window > Preferences > General > Editors > File Associations, select *.php and set PDT’s PHP Editor as the default editor.

Eclipse File Associations for PHP files

3. Restart Eclipse

To make sure your changes are saved (if Eclipse crashes before you close it, your changes may be lost).

4. There is no step 4

PDT should open PHP files, Aptana should open HTML, CSS, & JS files, and all is well in the world.

The folks at Aptana say that they an “Open Method” wizard of their own in the works, which I am very much looking forward to as Aptana Studio 3 is otherwise quite awesome.