Path Mapping In PHP Debugger
In this entry I would like to announce manual Path Mapping for remote debugging. Since NB6.5 it has been possible to debug both scripts and web pages, and web pages can be debugged either Locally or Remotely. For Remote Debugging, unfortunately the debugged php file on the remote server isn't the same as the file opened in NetBeans IDE running on a local machine. Debugger support in NetBeans must thus be able to map server paths to local paths, take into account that the server and client might run on different OS platform, cannot rely that the initially debugged file is really the debugged one because of rewrite rules, prepend files... Many more factors could be mentioned here but it means that path mapping cannot be resolved automatically for every individual scenario. That's the reason why for 6.7 we added the possibility to manually define path mapping through project setup for individual run configurations. In the next screenshot is a declaration for mapping from a Windows server path to a Linux local path.

Together with manual path mapping, two additional choices were added. The first one, "Ask Every Time," lets you choose the URL yourself just before the debugging session is started (see next screenshot). The second one, "Do Not Open Web Browser," only starts the debugging session and expects you to open your web browser and browse the URL yourself - anyway GET (or POST) variable XDEBUG_SESSION_START is needed.


Nice, I have been waiting for this feature, without it I can't debug anything because most libraries that we use are installed server wide.
Does this also mean that I can debug an arbitrary URL instead of an existing PHP file that must be inside the project directory (this was the case in previous versions of Netbeans that I have used)?
Posted by Joris on April 03, 2009 at 08:48 AM CEST #
You are supposed to start debugging from page(URL) mapped to arbitrary file inside of your project, the following pages doesn't need to be from inside project but then you need to ensure manually path mapping because these won't be mapped automatically which is also true for files in include path
Posted by rmatous on April 03, 2009 at 10:58 AM CEST #
Nice, now we can debug not only files but URL =) So, last step will be good FireFox extention, which add "Debug" button to toolbar and on press - will signal to NetBeans for start debug session =)
Posted by romary on July 15, 2009 at 08:40 PM CEST #
Thank you by adminim
Posted by mirc on August 23, 2009 at 04:20 AM CEST #
It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.
Posted by links of london on October 31, 2009 at 03:22 AM CET #