1
votes

I am setting up xdebug with netbeans for my PHP application, hosted on a local xampp installation (Windows 7)

The installation and command line tests were successful and working correctly according to the netbeans / xdebug documentation. However, when I add a breakpoint in my code, it appears as a "broken" breakpoint no matter where I place it in the code. When I run the app w/ debugger, it fails to stop at these broken breakpoints.

I've done a lot of searching but haven't come across a good explanation for this, anyone out there have suggestions?

Thanks

1

1 Answers

0
votes

Solution 1:

You need to configure the correct mapping between project source code and Xdebug output. you coudl do it here:

Project Window -> right click on project name -> Properties -> Run Configuration -> Advanced -> Path mapping

Solution 2:

Check in php info if xdebug is properly configured. You could check it by phpinfo() in empty php file and run it in browser:

<?php
 phpinfo();

Try to find:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Then in php.ini (you could check the location of this fiel in phpinfo() add this section:

[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/xamp/tmp"
xdebug.remote_handler=dbgp
xdebug.remote_port=9100
xdebug.remote_host=localhost

(make sure if this directory c:/xamp/tmp exists)

Then in netbeans in:

Tools -> Options -> PHP -> Debugging

Set: Debugger Port: 9100 and select "Stop at First Line"

Save it and debug the applictaion it should work fine now.