Debugging MediaWiki extensions with Eclipse for PHP and XDebug on Ubuntu 10.04

 I ran into some troubles with the debugging with XDebug in Eclipse for PHP Developers / PDT (breakpoints stopped to take / catch, after I changed location of my www folder - which I figured out later), so I wanted to document the full setup procedure it here. I mainly followed this blog post. (Assuming you have apache and php set up!).

  • Download Eclipse for PHP developers
    • I'm using the Linux 32 bit version
    • Because of a bug with PDT for Eclipse Helios, I chose to go with Eclipse PDT SR2 for now.
  • Install XDebug by typing:
 apt-get install php5-xdebug
  • Edit /etc/php5/conf.d/xdebug.ini to look something like this:
# xdebug.remote_log="/tmp/xdebug.log" 
    • The log line can be good to enable in case you run into troubles.
    • The first line can be different depending on PHP version. Use the line that you can find in the file (which is the default for your version of Ubuntu):
  • Restart apache:
 sudo apache2ctl restart

Configure Eclipse

  • Create a PHP Project. Mine is named "RDF4SMW".
  • Choose Run > Debug Configurations in Eclipse
  • Turn the configuration to your web server setup. For me, it looks like this ("smw" is the folder where MediaWiki is installed):

Custom location of www folder

Then an important thing If you have changed the location of your www folder from /var/www, then don't miss this! This was what caused the problem for me, with breakpoints not taking:

  • Click the "Configure" button in the Debug configuration screen seen above
  • Click the "Path mapping" tab
  • Configure according to the location of your www folder. My current config looks like so:
  • This should be it. Happy debugging!

Got Eclipse for PHP up running with XDebug

Got Eclipse for PHP up running now, with XDebug. Yay :) It was a snap to install on my Ubuntu box. I basically followed this and this blog post. (The Ubuntu package for XDebug is php5-xdebug).

The Eclipse dialogs had changed location and structure a little, so for my documentation, I included a screenshot of the dialog under "Run > Debug configurations" below.

3rd Project Update (Integrating SWI-Prolog for Semantic Reasoning in Bioclipse)

I just had my 3rd, and last project update presentation (before the final presenation on April 28th), presenting results from comparing the performance of the integrated SWI-Prolog against Jena and Pellet, for a spectrum similarity search query. Find the sldes below.

A usage strategy emerges

A strategy for how to work with the Bioclipse/JPL/Prolog/Blipkit combination I'm setting up, is becoming clear.

The main idea with Bioclipse, as well as with having a prolog engine available in it, is for flexible and "interactive" knitting together of knowledge. One of the main questions regarding how to use a Bioclipse/JPL/Prolog/Blipkit combination, has been where to put the bulk of knowledge integration/reasoning code? There would in principle be three options for that:

  1. Bioclipse (Javascript environment)
  2. The Blipkit-Prolog/Bioclipse integration plugin (Java code, a.k.a. "Manager methods")
  3. The prolog engine (As a prolog file)

Testing out querying Prolog from Bioclipse

My project has been more or less on hold for around a week because of exams and other stuff. Looking forward to getting some concrete things done now. While still reading up a bit on OWL, I've started taken the first steps of the prolog/blipkit integration with a simple method for querying a prolog on the form "subject, a predicate, and an object".

"Refcards" for quickly getting into Bioclipse Plug-in development

A link by Arvid led me to Dzone, where I found their "refcards": and after 15 minutes of reading, a lot of things, like file structure of Eclipse plug-in projects, had became much clearer.

For anyone new to Bioclipse plugin development, I think the following ones are the most relevant (especially the first two):

  • Eclipse Plug-in Development
  • Getting started with Equinox and OSGi
  • Spring Configuration
  • Spring Annotations

You will have to register at the site, and browse through the available ones in order to find them

Eclipse boot process, classloading, incorporation of native code etc.

This was a very good article on classloading and booting etc. in Bioclipse, with indispensable hints for how to best incorporate native code in eclipse plugins.


Prolog plugin for Eclipse

As a side-note, this looks interesting (Googled up by Egon), a Prolog Eclipse Plugin:

Could be interesting to combine that, in the future, with the results of my current project. Worth thinking about at least.

[SOLVED] How to set java.library.path for an Eclipse/Bioclipse plugin?

EDIT: Se solution at the bottom of the page

I'm trying to set the java.library.path system setting for my Bioclipse manager/Eclipse plugin.

Normally, if running java from command line, this variable should be set like so (According to what I've googled up):

java -Djava.library.path=/usr/local/lib/pl-5.7.15/lib/i686-linux/JavaClassName

so I have tried to add the line


to the arguments in "Run" > "Run configurations" for my plugin's product file, under the "arguments" tab.

Plugin development for Bioclipse - from scratch

I switched laptop recently, so I needed to set up my development environment for Bioclipse 2.2 plugin development from scratch. Since the instructions for how to do this are spread over a couple of blogs and the wiki, I used the occasion to create an integrated howto, for my own documentation as well as for anyone interested.