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 to localhost in Netbeans 6.8.

My problem is that breakpoints set in Netbeans are being ignored. Otherwise, it works correctly. For example, I am getting pretty var_dumps, xdebug traces, xdebug remote logs, and I can also mark this 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 have checked all of the following:

  • The php.ini file is used which I am editing
  • This xdebug is loaded as zend_extension = / full / path / to / xdebug.so (not extension = xdebug.so)
  • Thread safety is disabled in PHP and I am using the safe version of xdebug which does not support threads.
  • That the path to the breakpoints is correct in the remote xdebug log (see the code snippet below this list, the paths in this 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 make xdebug_break () work

I also tried setting the server path and project path in the Netbeans project properties because it looks like it might be the problem, but it didn't help. Currently I have the server /var/www/mockup

path as and the project path as/common/rsync/Dropbox/active-archives/code/Locus/mockup

However, /var/www/mockup

is a symbolic link to a longer path, so I don't even know if this is necessary? It doesn't work whether I specify the path display or not ...

+3


source to share


3 answers


Xdebug (via PHP) does not support symlinks yet (there is a problem at http://bugs.xdebug.org/view.php?id=627 ). PHP / Xdebug always uses a fully extended link, so you need to make sure netbeans sets a breakpoint, e.g .:

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

      



You will need to set up route mapping. Once you've verified that the breakpoint_set contains the correct path, it should work.

+1


source


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

  • Change NetBean project properties to copy files from source folder to /var/www/Locus

  • Remove all pathmaps from Run configuration
  • Point my browser at localhost/Locus/



In other words, it not only symbolizes the source file path that is causing the problem, but also symbolic links to the server paths.

+2


source


This is how I fixed it:

In my local xampp environment, on my mac, I have installed a vhost that is mapped to a directory outside the apache root directory (/ source / my_project). My project on the Beans network has been configured to use / source / my_project as the project location. So I had problems displaying URLs as the path I used in Apache vhost is no different from what I used in Net Beans. Or perhaps Apache was thinking about this directory other than Net Beans, I couldn't get the route mapping to work anyway. But when I moved / source / my_project to / apache / htdocs / my_project and I used this path for the Net Beans project source and mapped my vhost to that directory then the debugger worked. Postscript I had version control set to / source / my_project,so I changed my_project to a symbolic link and was still working in subversion.

0


source







All Articles