Installing Eclipse as your IDE for developing PHP webapplications
1 03 2007During the last couple of month I had to install my development environment over and over again. On my private as well as on work computers. It took me a while to find the ideal setup for myself and in the process of that I tried and tested many plugins.
This is to describe my current Eclipse setup for developing web applications. Techniques used include Javascript, XHTML, CSS, PHP, MySQL, XUL and Subversion.
Based on my experience I made a number of decisions.
PDT (former PHP-IDE) over PHPEclipse
PDT proved to be more stable and feature rich. It is developed by Zend who also developed Zend Studio so you can expect to get a lot of the key features you would normally have to pay for. PHPEclipse proved unstable to me when used together with other plugins that also added/changed editors. Most of the times the outlining feature plainly disappeared.
Aptana over JSEclipse
JSEclipse by Interakt was one of the plugins in constant trouble with PHPEclipse. Its outlinings as well only worked for me for a short time after the install. Then it just disappeared.. It is now hosted at Adobe labs which might be an indicator of future improvement? It is definitly interesting so I will keep an eye on it.
Subversion over CVS
If you find yourself in the lucky position to choose between the two then forget about CVS! Think of Subversion to be a direct decendant of CVS having learned of all the misconceptions of its predecessor. For those of you wondering why they should use version control at all i won’t even go into this.
The ideal install order
This is important! The Aptana IDE comes as a download and might appeal to you but beware that for PHP you will have to install PDT manually. PDT comes with a lot of dependencies many of which you won’t even know where to get them from. Installing it manually basically is a pain in the arse. The guys from Zend fortunately know that apparently and provide an All-In-One package for you to download. All dependencies are included and once installed you can add all the plugins you like without any difficulties (this is valid at least for all plugins I included in this post).
Installation
- Download Eclipse PDT All-In-One package from here
- Unpack downloaded zip file into C:\Program Files\Eclipse
- [optional] Create link to eclipse.exe in your quick launch bar
- [optional1] download viPlugin from here
- [optional1] extract viPlugin to your eclipse directory
- Open Eclipse
- Go to Help->Software updates->Find and Install and choose ‘Search for new features to install’
- [2] add new Remote Site ‘Aptana Plugin’ /
‘http://update.aptana.com/install/’UPDATE: New remoteURL’http://update.aptana.com/install/3.2/‘ - [optional3] add new Remote Site ‘Orangevolt EclipseXUL’ / ‘http://eclipsexul.sourceforge.net/update-site’
- [optional4] add new Remote Site ‘Subclipse’ / http://subclipse.tigris.org/update_1.2.x’
- [optional5] add new Remote Site ‘SQL Explorer’ / ‘http://eclipsesql.sourceforge.net/’
- [optional6] check ‘Automatically select mirrors’
- Select all available updates from the list except for Subclipse/Mylar support (unless you need it, but I’m not sure what else you needfor that)
1/ This sets the Eclipse editor to vi mode. well vim actually. But you need to buy a license. I know that’s ridiculous but well worth it and not too expansive and the license never does become invalid.
2/ The Aptana plugin provides everything you need for proper XHTML, CSS and javascript development. Editors and outlining. All that sweet goodness.
3/ The Orangevolt EclipseXul plugin is the best XUL plugin around. If you fancy writing your own Firefox extensions or applications even this is what you need.
4/ Subclipse is the subversion plugin for Eclipse. CVS comes out of the box but if you can choose subversion instead then you really should.
5/ SQL Explorer provides you with a nice and clean graphical interface to your database(s). For each DBMS you need a connector. I so far oinly needed to connect to MySQL that’s why I only explain how to install those.
6/ Unless you really want to do a lot of customized clicking.
No SQLExplorer perspective?
For reasons I do not quite understand I could not get the perspective SQLExplorer but instead got Database Development. The latter did not come with an SQL Editor view. I solved this (quite unelegantly) by installing SQLExplorer manually from here.
Configuring Subclipse
I am not going too deep into this. There are plenty of instructions to find on the web. But make sure you go to Window->Preferences and to Team->SVN and switch the SVN Interface to SVNKit (pure Java). Everything that you read about using TortoisePling.exe or putty’s pling.exe is obsolete now. SVN now works without external tools. For your convenience you can of course still install TortoiseSVN if you want.
Configuring SQL Explorer for MySQL
Now you need to add a connector to your database. You can google for a java connector for your database. I use MySQL and you can get the current connector for that here. I suggest to place it in C:\Program Files\Eclipse\connectors (you have to create the folder first). Thengo to Window->Preferences and choose Connectivity->Driver Definitions.
Choose MySQL->4.1->MySQL JDBC Driver and edit it. Remove the jar already in there and add the one you just downloaded.
Summary
Once you have installed all the above you can start developing PHP, Javascript, HTML, CSS and XUL (and of course Java but then again.. ). You can add more plugins if you like but choose carefully and always make a backup of yourEclipse folder first to have a fallback version if some plugin messes around with your IDE.
At the end of this installation my Eclipse folder added up to about half a gig in size. That’s how much you can get for free.
Have fun!
/christian
Additional
Two more plugins can ease your Symfony developments.
- Azzurri Clay Database Designer for Eclipse. To install this plugin see here.
2. Symfoclipse providing some shell integrations and finally a basic YAML editor! For installation see here.
aptana, css, databases, eclipse, eclipsexul, html, ide, installation, installing, javascript, mysql, pdt, PHP, plugins, sqlexplorer, subclipse, subversion, vi, vim, viPlugin, XHTML xul






Good one. I almost thought of suicide when trying to install PDT in an existing eclipse installation, as I still wanted to have subversion & co. Your post was a good guide because it proved it was possible to have subversion with pdt.
Although for some weird reason now that I followed your list and I’ve a shiny PDT installation, I’m not getting the outline in php files. Ahh… eclipse!
Thanks anyway!
@sole Thanks for your kind words. I know just how you felt.
If you ever happen to find a solution for bringing back lost outlining please give me a note! this seems to happen irregularely and is very annoying indeed..
Great resource! I’ve been virtually struggling with the same issue — no real world experience… as I’ve yet to migrate from PHPEclipse.
Thank you for outlining this process.
Very nice! Now I have PDT runnig at last.
If you do a lot with symfony, I would as well recommend the wicked shell plugin to execute all those ’symfony cc’ commands easily from eclipse.
Hi Christian
Really very good post, i’m sending your url to anyone who had opened eclipse for the first time, it helps me to avoid many questions about features, advantages and installation of eclipse. To be honest i also did step by step all what you described here, it was real enjoy. Remembering time when we were working together.
So what is my filling, after aptana plugin installation i get a lot of features, but also loose one which is most usable for me, it is open PHP element (which is in PDT) it is very usable in big project when you know methods, classes names but lazy to go there by navigation.
Also one thing PHP outline which provides PDT is more suitable for me, plain method list, without filter and without collapsing, just because i don’t like huge classes in PHP with huge amount of methods in it, i’m happy when whole outline is in short list, not scrollable, and when you want to see methods , you are pressing hot Key for opening outline .. thats it, in aptana you should additionally uncollapse group header named “php” (what else can be in same class, java? why i need that group?).
for alternative option i can suggest ZendNeon, functionality is quite good, (ja? and why they didn’t put in huge list of supported formats perl, is perl became so archaic ?), …
hey garik,
can’t say what the problem is. might have to do with current versions?
you may leave aptana out altogether if you don’t really need it..
my 2 cents
/christian
@Martin
Great tip! Thanks for sharing!
/Christian
I’m glad some one finally got this on paper. I’ll have to give it another shot. I pretty much did the same thing except subclipse preventing the PDT from doing syntax highlighting. Has any one else had this problem? Or does using the Aptana PHP plug-in fix this?
Thanks,
Owen.