2
votes

is it possible to debug with Netbeans xdebug between 2 separate projects?

One project is main code, second one is a library. I can successfully debug the main code, but the library does not work for me, the Netbeans debugger simply skips the breakpoints.

I use Netbeans 7.2 and XDebug 2.2.1.

I tried to create a symlink reference between projects as described here (http://stackoverflow.com/questions/5746952/xdebug-across-projects-in-netbeans), but this did not solve the problem.

I also tried to link the 'lib' project as a 'library', but this also did not fix the problem.

Any ideas?

3

3 Answers

1
votes

I don't think Netbeans allows for debugging two different projects at the same time. So you will have to merge those two projects into one.

1
votes

It's an xdebug issue with symlinks, but looks like there's a patch if you want to try that: http://bugs.xdebug.org/view.php?id=627

0
votes

My setup is this: I use a remote web server where the main project code and the library is hosted. I've mounted the main project as a drive on my local PC (using MacFusion), and have NetBeans work directly on the files there. My NetBeans Run Configuration is set up to use the remote web server.

The following recipe works for that setup:

  1. Create a symlink to the library in your main project (and have your SCM ignore it)
  2. Do a Scan for External Changes in NetBeans
  3. Go to the Properties > Run Configuration for your main project
  4. Click the Advanced button and add a new line to the Path Mapping table
  5. Enter the absolute (remote host) path to the library in the Server Path column (not the path to the symlink you created)
  6. Enter the local absolute path to the library symlink

I've yet to test this for a local stack setup, but I think it should work fine. The trick lies in the symlink and path mapping combo.