Reputation: 193
I am trying to debug a local Wordpress instance (on xampp) in NetBeans, on Windows 7. For some reason the breakpoints outside of any file living in the webserver's root are ignored.
I have Googled around for ages, to no avail. I have read SO1, SO2, SO3, SO4, SO5 and SO6, also to no avail. All these SOs mention Path Mapping. I have mapped all my folders, but since my project folder is the same as my project folder, these mappings are exactly the same. Moreover, the path in the xdebug log points to the correct file (see below).
Calling xdebug_break();
only works when it is called in one of the files living in the webserver's root (`wp-develop' in my case), so I suspect I'm not mapping the paths correctly.
The portion of my php.ini file that is related to xdebug looks like this:
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = On
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_port=9000
xdebug.trace_output_dir = "C:\xampp\tmp"
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.remote_log = "C:\xdebugremotelog.txt"
The output of the xdebug log looks like this:
<- breakpoint_set -i 122 -t line -s enabled -f file:///c:/xampp/htdocs/wp-develop/wp-content/themes/gap/gap.php -n 32
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="122" state="enabled" id="81240001"></response>
c:/xampp/htdocs/wp-develop/wp-content/themes/gap/gap.php
is the correct path.
What am I missing here? Any help would be appreciated.
In fact, I think I might be doing the Path Mappings wrong. Could someone give me an example of how they should actually look?
Upvotes: 0
Views: 1080
Reputation: 3575
I have had a similar problem on a Windows system: Eclipse breakpoints work fine for any php command-line project and don't for any web application. I have spent two hours to solve the problem.
Please check if your web server is listening on the 127.0.0.1 address and not on "localhost". Why ? Because from Vista up, Windows uses ipv4 to connect to 127.0.0.1 while it uses ipv6 to connect lo the "localhost" address.
So, the solution is to use ipv4 on all the debug stack:
Launch the php built-in webserver (any or other) to listen on 127.0.0.1
I hope that this will help you
Regards from Italy
Upvotes: 1