0

My XDebug extension is not establishing its connection with netbeans. Following are the settings which i have placed in php.ini file:

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost:8080"
;xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

Please help me in figuring out the problem. Any help would be appreciated.

Zawar
  • 25
  • 6

1 Answers1

0

To debug your php code in Netbeans IDE you should enable XDebug in Netbeans. To do that goto Tools - Options there select PHP tab and ensure that Debugging port and session ID matching with your XDebug configuration in php.ini file. After that click on OK.

Change your php.ini file 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 = 1
;xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"  <--- here
xdebug.trace_output_dir = "C:\xampp\tmp"

And restart your Apache server [XAMPP or WAMP].

If this solution not working goto localhost in your browser select PHP version tab right click select all and copy the contents and paste it here. If you have old version of XDebug then download the latest php_xdebug.dll file. Copy it to C:\xampp\php\ext\ directory and it's done.

Shashanth
  • 4,995
  • 7
  • 41
  • 51
  • I have tried your solution Netbeans cant connect to xdebug it keeps connecting forever. – Zawar Aug 23 '16 at 09:39
  • Check this [Stackoverflow thread](http://stackoverflow.com/questions/17613726/netbeans-shows-waiting-for-connection-netbeans-xdebug) and [this](http://www.devside.net/wamp-server/netbeans-waiting-for-connection-netbeans-xdebug-issue) – Shashanth Aug 23 '16 at 10:00
  • oh! it worked finally. thankx. i only copy pasted your settings. forgot to add port=9000. thank you it is working. – Zawar Aug 23 '16 at 10:23