listen > understand > code > teach

Speeding up Eclipse PHP debugging by using an external web browser

Today I got my environment for debugging PHP web pages working much more snappily, and I'm excited to share my tips. My experience only applies directly to you if you are running Eclipse and debugging PHP on a Macintosh with OS X.

Last weekend I scored a free VGA LCD monitor from my brother-in-law who didn't take it to law school with him and is now loaning it to me for at least a couple years. I was thinking "Free screen real estate, what could be better? I should be able to put the debugging web browser on one and screen the rest of my debugging windows on the other." After I got the right adapter to connect it, that is.

Once it was connected, the new monitor was somewhat convenient, but I quickly discovered that I couldn't put my Eclipse internal web browser in it's own window and move it to the other monitor. For some reason, Eclipse kept insisting on opening a new internal browser in the pane with the editing windows even if I had already opened the internal web browser in it's own window with "Window | Show View | Other... | Internal Web Browser" before I started the debugging session. And I was not allowed to "detach" the internal web browser tab from that pane and make it a separate window.

So I tried setting Eclipse to use an external browser for debugging at "Eclipse | Preferences... | General | Web Browser", reasoning that I could surely leave the external web browser's window on a different monitor from the Eclipse window I was using. Well, after a lot of time trying things I was left with only Firefox seeming to work. But it seemed slow and if Eclipse was running, Firefox was *always* starting the debugger in Eclipse and being very slow. Firefox is my browser of choice because of the Firebug plug-in, and Eclipse is about always running on my system. I just couldn't stand my main tool always being slowed to a crawl.

So I started trying every other Mac browser I could find until I discovered Camino. And it worked and even got invoked by the Eclipse debugger at the right time, but unfortunately it gave me errors like:
caminofnf.jpg

So here the main tip. Edit the settings for launching Camino at "Eclipse | Preferences... | General | Web Browser". In the Parameters edit box add the command-line option "-url %URL%" and Camino will start working as your Eclipse debugging browser.

The coolest thing is that my debugging between breakpoints started going several times faster. I was thinking that perhaps I needed a new computer to get faster debugging. But, it seems, that Eclipse's internal web server really bogs it down. So not only do I get more space for my other debugging panels with the new scheme I get a much faster PHP debugging system overall. Good deal! It would have been a good idea to do this even without getting a second monitor. If only I had known sooner that my setup for PHP debugging could be so quick and responsive. But at least I know now, -- and hopefully reading my story will help some fellow developers.

Drupal SEO