Wednesday, January 31, 2007

phpEclipse

I have been look at PHP IDEs for a while now. I'm quite happy playing around with gEdit and having some rudimentary code colouring, but it get confused with PHP and HTML at times and doesn't really work too well when you add in Javascript.

I did use the trial version of Zend Studio 5 for while on a previous incarnation of my system, but an upgrade came and I didn't want to shell out a significant amount of money for an IDE. I'd love to find an open source alternative...

I have tried BlueFish (2/5) and nuSphere (a lot of cash for not as good as Zend) along with other not so impressive alternatives.

Finally I stumbled across phpEclipse and thought I'd give it a go. It seems though, that from other blogs and forums, installation on Ubuntu Edgy is no mean feat. So, armed with google, I set off on another intrepid adventure.

After installing Eclipse and phpEclipse, finding some bugs and searching the internet to find solutions, I became more aware of another project: EasyEclipse.

EasyEclipse:
It does extactly what it says on the tin and a simple download will give you a working copy for Windows, Linux or Mac. I chose EasyEclipse for PHP, but if you have a LAMP server, there is a version for LAMP control too Basically, the different distributions comes with different pre-loaded modules. The PHP one has PHP, SVN, HTMLTidy and many more.

The download is about 130Mb, so takes a wee while, but there is no "install": just run the app and it works. You'll need Java installed and it works with Blackwater (the opensource version) as well as the official Java from Sun.

SVN:
Once downloaded and running, "change perspective" using the menu or the top right button and choose 'SVN repository'. Using the left hand side taskbar, add a new repository (http://www.carrubbers.org/svn/ccc/www) and check out. You'll be asked if you want to create a new project (yes) and asked for the location. For me, with the current apache config the way it was, this was '/home/ccc/'. Once the checkout was compelete, I just needed non-SVN files: images, xml and dbf, along with .ht*, postgres login and symlinks (see the previous post).

PHP browser:
There is a build in browser which seems to work pretty well. You'll need to specify the document_root and localhost vars first:
Window->Preferences:
PHPeclipse...->Project Defaults ->
localhost and document root
If the document_root is wrong, Eclipse seems to think that files that are included by the PHP files are not within the current project and gives errors.

NB: I couldn't find how to use SVN for a while. It's under the Navigator context menu under "Team".

Now I just need to work out how to use the build in apache controls, get SVN icons rather than CVS ones on the navigation pane and see about Postgres control too.

Then there is the task of getting debugging working: DBG is allegedly a good tool to use and natively supported (client side) in eclipse. It's just a case of installing the software server side - I'll try it locally first!

No comments: