1
votes

I have spent quite a bit of time on this with no success. I am trying to connect my Xdebug through NetBeans to my Vagrant server.

The IP address of the Vagrant box is 192.168.33.10.

When NetBeans opens the debugging connection it says that it's looking at 192.168.33.1.

My php.ini settings are as follows

zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.profiler_enable=1
xdebug.profiler_output_name="cachegrind.out.%t.%p"
xdebug.collect_params=4
xdebug.collect_return=1
xdebug.remote_enable=1
xdebug.remote_log = /tmp/xdebug.log
xdebug.remote_port = 9000
xdebug.remote_host=192.168.33.1
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=0
xdebug.idekey="vagrant"
xdebug.remote_mode=req
;xdebug.remote_connect_back=1

In NetBeans my project URL is set to http://192.168.33.1:9000 debugger port is 9000 and Session ID is vagrant.

I know that NetBeans also looks at IP address 10.0.2.2 and I can't get this going either. When I run the debugger NetBeans just says that it's waiting for connection and my log stats that the connection has timed out.

I have also tried it with remote_connect_back=1 and to no avail.

1
1) Read the docs first to have an idea of how it all works. 2) "In NetBeans my project URL is set to http://192.168.33.1:9000" -- this is just wrong -- the 9000 port is for xdebug connecting to NetBeans and that's it -- it should NOT be used in any URLs. 3) NetBeans must be listening on TCP 9000 port; As I understand the IP where NetBeans is running is 192.168.33.1 -- as that's where xdebug will be trying to connect. It's possible that the IP is wrong (see what xdebug log says when remote_connect_back=1 -- it may detect another IP). - LazyOne

1 Answers

0
votes

Thank LazyOne for your feedback much appreciated

What I had to do to get this going was to open the ports 9000 on my windows machine and port 9000 on my server. I then login to my ssh server connecting to 127.0.0.1:2222 as specified by the vagrant bootup messages. Then set up a ssh tunnel to connect to port 9000. I did this using putty