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. 

Path Mapping Customization

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.

Ask For Ever For URL

Comments:

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 01: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 03: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 01:40 PM CEST #

Thank you by adminim

Posted by mirc on August 22, 2009 at 09:20 PM CEST #

Sweet! Took a while to find this but this works beautifully (so far). I'm a complete newbie (< 1 day) to netbeans (previously Eclipse which I could never get the debug to work) and I'm really pleased. Thanks

Ubuntu 10.05.01 (lucid)

Posted by john.lamont john.lamont on July 26, 2010 at 04:39 PM CEST #

how about the xdebug without using xmapp, i just trying apache 2.2, mysql 5.2 and php 5.3

is it possible? what modifications in the cofig file i must do?

thanks in advanced

Posted by gerardo on August 22, 2010 at 10:10 PM CEST #

jhkhjk

Posted by guest on February 22, 2011 at 03:57 PM CET #

545

Posted by guest on March 24, 2011 at 04:56 AM CET #

Also note that you can set a debugger proxy in this dialog, if you need one.

Posted by JeffRubinoff on July 13, 2011 at 09:31 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today