cfogelberg
cfogelberg

Reputation: 1488

Why is XDebug ignoring breakpoints from NetBeans 6.8?

I am running PHP 5.3.2, Apache 2.2.14 and xdebug 2.2.0rc1 on my Ubuntu 10.04 laptop, and I am trying to set up debugging on localhost in Netbeans 6.8.

My problem is that breakpoints I set in Netbeans are being ignored. Otherwise it it seems to work correctly. For example, I get pretty var_dumps, xdebug traces, xdebug remote logs and I can also tick the box so that it breaks on the first line of the PHP script.

Based on other websites and SO questions (e.g. SO1, SO2, SO3) I've checked all of the following:

I have also tried to set up the server path and project path in the Netbeans project properties because it feels like that could be the problem, but it hasn't helped. Currently I have server path as /var/www/mockup and project path as /common/rsync/Dropbox/active-archives/code/Locus/mockup

However, /var/www/mockup is a symlink to the longer path anyway so I don't even know if this is necessary? It does not work whether I specify the path mapping or not...

Upvotes: 3

Views: 2507

Answers (3)

N D
N D

Reputation: 737

Here is how I fixed it:

In my local xampp environment on my mac I had set up a vhost that mapped to a directory outside of the apache root directory (/source/my_project). My project in Net Beans was set up to use /source/my_project as the location of the project as well. So I had "no" URL mapping problems since the path I was using in the Apache vhost was no different than what I was using in the Net Beans. Or perhaps Apache thought of this directory different than Net Beans in anycase I could not get path mapping to work. But when I moved /source/my_project to /apache/htdocs/my_project and I used that path for my Net Beans' project source and mapped my vhost to that directory then the debugger worked. P.S. I had version control set up on /source/my_project so I changed my_project to a symbolic link and it still worked in subversion.

Upvotes: 0

cfogelberg
cfogelberg

Reputation: 1488

Building on @Derick's input, the solution that works is:

  • Change NetBean project properties to copy files from source folder to /var/www/Locus
  • Remove all path maps from the Run configuration
  • Point my browser at localhost/Locus/

In other words, it's not just symlinks in the path to the source file that cause problems, but symlinks in the server path as well.

Upvotes: 2

Derick
Derick

Reputation: 36794

Xdebug (through PHP) doesn't support symbolic links yet (there is an issue at http://bugs.xdebug.org/view.php?id=627). PHP/Xdebug always uses the fully expanded link so you will need to make sure netbeans sets up a breakpoint like:

breakpoint_set -i 1014 -t line -s enabled -f file:///common/rsync/Dropbox/active-archives/code/Locus/mockup/test.php

You will have to set-up a path mapping. After you've verified that the breakpoint_set include the correct path, it should work.

Upvotes: 1

Related Questions