Netbeans for PHP: Continues to Impress


It seems that I don’t blog much unless IDE’s are concerned; there is a good reason for this: IDEs are an integral part of my development process and when they suck, development sucks.

The story so far:

  • Boy meets ZDE 2.5
  • ZDE grows up to 5.5
  • ZDE gets replaced by new eclipse-based ZSfE/PDT
  • ZDE keeps going, until one day, Boy upgrades OSX
  • Boy hacks OSX, but ZDE is running on a donut
  • OSX update kills ZDE for good
  • Boy cries
  • Boy finds Netbeans

This is the continuation of that story. In the last installment Netbeans 6.7 was a nightly build, it had gotten it’s OSX look and feel, and it was starting to get it’s remote debugging up and running.

Now, 6.8 has been out for almost 2 months, and things are really starting to gather steam. With the death of ZDE5.5 finally a reality, and PHP 5.3 code starting to become part of my work-day, I finally jumped 100% to Netbeans.

And let me tell you, Netbeans 6.8 is nothing short of amazing. Debugging with xdebug is now almost as easy as ZDE, it works instantly on 90% of my remote machines, but I have 1 cluster for which Netbeans simply *cannot* find the local source file, making it impossible to debug.

Watches, breakpoints (though, I haven’t figured out conditional breakpoints, if they are there), callstack and local variables work as you would expect (though watches/variables sometimes refuse to populate larger vars, I think this is xdebug config related). In addition, Netbeans supports arbitrary breakpoint groupings; these can be enabled and disabled as a group — very neat.

In addition, it has path mapping to help with remote/local file correlation; so it can find the local file to show the source during debugging — this stops the problem ZDE has where two files have the same basename() and it’s unable to choose the correct one.

However, a fully functional debugger is a minimum requirement. Netbeans 6.8 also has great support for PHP 5.3 (though it has some syntax support bugs), again another minimum.

So where does Netbeans shine? The single biggest answer to that, is PHPUnit support. Netbeans lets you specify your test folder, and abstracts it out of the project, so your tests are separated visually; this is a great minor addition. In addition, Netbeans can generate unit tests (this utilizes phpunit’s built-in functionality), and has a great UI for running tests.

You can run a single unit test by simply right clicking on the test and choosing Run, or you can test a whole project by right clicking on the project and choosing Test. Doing this will bring up the Test Results pane:

As you can see, it shows the number of tests, the test suite, and it’s test status; this can then be expanded to show individual test methods.

Further to this, you can have Netbeans capture code coverage information, if you have the xdebug extension installed locally. This then manifests visually in two ways; the first, is a summary:

The second, more impressive/useful way, is visually within each file:

You will also notice that this adds a set of buttons below the code, which can be used to run the test for just the current file (based on the typical phpunit file/test naming structure, I assume) and to re-run the entire test suite.

To me, this integration is phenomenal, and is changing the way I work. This is a great example of an IDE conforming to your workflow, and proving new ways to do things; rather than fighting you and requiring you to change to it’s needs and ideals.

Other things of note, Netbeans 6.8 has Symfony project integration, and 6.9 is including Zend Framework integration, if those things appeal to you — I have yet to play with either, so can’t comment on their usefulness.

I can, without doubt, confidently say, that despite the few bugs, and some still immature minor things, Netbeans is my recommendation for an IDE.

Go grab Netbeans today.

– Davey

Cube°n for NetBeans on OSX (and others)


One of the things I’ve been most excited about with NetBeans, is the prospect of hooking it into Trac using Cube°n. Now, I should note that I didn’t even think about doing this till I ran across Mylar for Eclipse.  So, I went ahead and downloaded Cube°n, and installed it using the NetBeans plugins workflow:

Adding Downloaded Plugins to Netbeans Simply download and unpack the ZIP file (2.7MB) and then in NetBeans, choose Tools » Plugins, click the Downloads tab, and then Add Plugins… 

 In the file picker, just select all, and click Open. Next, click Install

 In a world where everything “Just Works”, that would be it. But unfortunately, on OSX, it’s sometimes not. While the plugin appears to function fine, when you to make it grab tickets, you will get a wonderful uncaught exception dialog.

 By default, OS X Leopard does not have the Java 6 (1.6) environment, so check if you have it. You can do so by looking to see if you have /System/Library/Frameworks/JavaVM.framework/Versions/1.6, if not you will need to grab Apples Java for Mac OS X Update 1 (57MB), Update 2 (136.4MB) and Update 3 (3MB) 

 Finally, even if you have Java 1.6, you will probably need to modify your NetBeans config to use it. This can be found in /Applications/NetBeans/NetBeans$


Open up this file, and look for: 


And change it to:


Once this is done, just re-start NetBeans.

Add New Repository » Trac Repository » Trac Repository Settings

Next, go to Window » Cube°n » Task Repositories, and a new pane will appear in the bottom left under your Project/Files/Services pane. Right click in the new pane and choose New Task Repository; choose Trac Repository and give it an Alias (a name), and the rest of the information it needs.

Choose Validate Connection and then Finish. If you encounter an SSL error, see the Cube°n FAQ.

Finally, you can add queries to grab whatever collection of tickets you would like. You use the TracLinks query syntax which means you can create complex filters.

I have a filter for My Active Tickets, “owner=USERNAME&status!=closed|testing” and one for each milestone so I can see and accept tickets that are not mine, “milestone~=iris&owner!=USERNAME&status!=closed|testing”

Working with Tasks

Activate a Task to start creating it's Context

One of the biggest benefits of working with Cube°n [and Mylar] is the ability to associate a context with them; that is your open files, and other related tickets. To do this, simply click the Activate button. Once this is done, any currently open files are automatically associated with the ticket… or at least they would be if you were using Java. *sigh*

Still, it’s a start. Hopefully the guys at Cube°n will fix this oversight soon enough, and us lowly PHP developers will get in on the fun.

They are already working on some neat features, such as allowing you to commit to RCS using the task context (i.e. close a task, and commit all associated files), as well as associating debugger breakpoints and watches with the task; allowing you to make those task specific, even when two separate issues touch the same files. Both of these features would be great, making sure you don’t forget to commit a related file, and imagine being able to go back to a task 6 months later because a related issue has come up and having all your original files and debugging settings immediately available.

– Davey

Detailed IDE Reviews: How do you want to do this?


So, dear readers, I’m doing the IDE reviews for all of you guys and there’s two ways I can proceed:

I can take each of the requirements and do a single post per requirement with a writeup about it in detail for each of the 4 IDEs — then I was thinking for each new IDE I try, I can hit those same points. Or I can write up specifically on a single editor at a time, covering all of the requirements and I will also then review anything else about the editor etc.

I’d like to do a single post on the cross-platform technologies in play (Java Vs XUL) and on the Eclipse and Netbeans platforms (outside of any PHP plugins), but these fall outside of the scope of the original intention of reviewing the IDEs.

There are several incarnations of Eclipse I would like to review: Zend Studio for Eclipse, Aptana and PHPEclipse, I think perhaps I need a comparison table for Eclipse solutions on their own ;)


– Davey

IDE Comparison


So it seems that some people want to know my opinions on different IDEs that I have tried in my quest to find a good upgrade path from Zend Studio 5.5  — as such, I have created a new page with an overview of my requirements, and a table comparing the various IDEs I have tried.

Check out the IDE Comparison

I plan to follow up the page with in-depth posts on each requirement and how each IDE matches up. Furthermore, any new IDEs I try will get a write-up on each of the requirements. Look for these in the coming weeks and months :)

– Davey

Update: surprisingly, it took over 2hrs to get an e-mail telling me that VIM was the perfect IDE; I expected it far sooner. VIM might be the perfect IDE for some, but not for me. Though I do use it daily as a text editor on remote systems and like it for that purpose. Also, it’s great for editing xdebug human-readable traces thanks to Derick Rethans vim syntax file.

Netbeans: The Other Open Source IDE Platform


After seeing a SitePoint post on the Netbeans IDE I was intrigued by it’s new PHP support added in 6.5. I had toyed with Netbeans before when I was doing some Java-Swing development, some time around the 4.x version IIRC. I’d like it back then, for what it was, a Java IDE. I must admit it had slipped my mind since then; however I am still on the look out for a migration path away from Zend Studio 5.5 that doesn’t include Eclipse (which I  despise, Zend Studio for Eclipse/Zend Studio 6.0/PDT are a poor replacement for Zend Studio 5.5 as far as actual use goes).

The migration path is important for me not only for myself, for my team at work. Currently we use a mish-mash of ZDE 5.5, PDT (though nobody likes it, it’s free and does work with the Zend Debugger) and text editors.

I tried Netbeans 6.5 at the time the SitePoint post hit Planet PHP and while it seemed to work well enough, I didn’t have enough time to play with a new IDE at that point — also, the fact it looked terrible on OS X didn’t help — so I put it aside.

Then along came Solaris. Rather, a segfault in PHP on Solaris that I had to debug. I grabbed a VMWare disk image for OpenSolaris 2008.11 and booted it up in VMWare Fusion (a very pleasant experience I might add, just download, double click and I had a GUI booting OpenSolaris loading up Gnome!) and started to see if I could replicate the issue. After some advice from Wez Furlong I had SunStudio installed so I could use `dbx`, the Solaris “native” equivalent of `gdb` to figure out the problem. After fiddling with `dbx` for about 30 minutes, my co-worker said “This would be so much easier if you had an IDE that would pull up the source…” and it clicked: Why not try SunStudio? 

Turns out, SunStudio is to Netbeans as StarOffice is to Within a minute I had it attached to the PHP binary, ran my command and it automatically found and pulled in the PHP source; within 20 minutes I had narrowed the bug down to an issue in libmysql‘s prepared query code (with some help from Scott MacVicar regarding the PDO internals).

So, here, once again was Netbeans on my radar, and in this particular instance, shining, working flawlessly and helping me find an issue on a platform I’ve never used before, in minutes.

The next step — last night — was for me to try Netbeans 6.5 again, however another co-worker who has started using it, complained it wouldn’t bring up the source for remote files when debugging, so I grabbed the 7.0M1 build to see if this had fixed the issue. Once again, I was assaulted by the terrible Look and Feel, so I spent about 20 minutes trying to change it to at least use the familiar Java (metal) L&F with no success.

Today I decided to take another look and noticed in the “News” section of the IDE start page something about version 6.7 — confused, I read the linked story and saw that they were re-doing their versioning; from there I went to read the notes on what was changing, and there, I saw:

Better looking look and feel on Mac OS X:

New Mac Look & Feel

Now, it looks great on all platforms, it uses xdebug which means my team can pick and choose their IDEs (though I’m considering instituting NetBeans across the board anyways), it’s OSS, free (as in beer) which sits greats with management and most importantly… competent.

Netbeans, like Eclipse bills itself as an IDE platform, moving away from it’s Java roots, to include support for PHP, JavaScript, SQL, various markups and even Ruby/Rails. In addition it’s cross-platform like eclipse but worlds ahead in usability, look and feel, speed and resource usage.

I suggest if you’re looking for an alternative to the aging Zend Studio 5.5, Netbeans should be your first stop.

- Davey


Grab the Netbeans Nightly build for the new OS X L&F