Reputation: 1488
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:
That the path to the breakpoints is correct in the xdebug remote log (see code snippet below this list, the paths in that snippet and others not shown are correct)
<- breakpoint_set -i 1014 -t line -s enabled -f file:///var/www/mockup/test.php -n 8 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1014" state="enabled" id="135610002"></response>
Manual calls to xdebug_break() work
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
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
Reputation: 1488
Building on @Derick's input, the solution that works is:
/var/www/Locus
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
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