Xdebug for remote server does not connect - netbeans

I am trying to use XDebug in the following script

  • my computer is Windows 7, Netbeans 6.9
  • A physical host on a computer on the same network (Windows 7) with a virtual box
  • Virtual CentOS 6.2 with Apache 2.2.15 and PHP 5.3.3
  • The PHP code for my website is located in the CentOS shared folder in / var / www / html / mysite and has separate access and can access it through the ip server 192.168.1.240
  • Edited C: \ Windows \ System32 \ drivers \ etc \ hosts 192.168.1.240 mysite
  • PHP code is available from my Windows host on \\HostIP\html\mysite with R / W permissions

I created a Netbeans project on my computer, pointing to \\HostIP\html\mysite . In the project "Run configuration" I have the following:

  • Run as: Remote website
  • Project URL: http://mysite/
  • Index file: index.php (exists in the project)

In the advanced launch configuration:

  • I checked the "Default"
  • I did not touch the proxy settings

I have php.ini on my CentOS VM

 ;extension=xdebug.so zend_extension="/usr/lib64/php/modules/xdebug.so" xdebug.remote_enable=on xdebug.remote_log="/var/log/xdebug.log" ;xdebug.remote_host=192.168.1.31 xdebug.remote_connect_back=1 xdebug.remote_handler=dbgp xdebug.remote_port=9000 

note: I tried the configuration using extension=xdebug.so and tried to comment on xdebug.remote_connect_back=1 with uncomment xdebug.remote_host=192.168.1.31 , which is my computer IP address.

so basically i have all the configurations like this image enter image description here

but still not working! after launch, the debugger will open this URL

 http://mysite/index.php?XDEBUG_SESSION_START=netbeans-xdebug 

and nothing will happen just netbeans listing waiting for Xdebug to connect

+8
php xdebug virtualbox netbeans remote-debugging
source share
3 answers

When I want to debug a remote host, I usually have to forward my local 9000 port to the local 9000 server of the remote server through the ssh tunnel:

ssh -R 9000:localhost:9000 username@remote.example.com

Use bitvise ssh client or putty for windows to get the same effect.

Also in the project settings β†’ start configuration β†’ Advanced button

be sure to specify the remote and local full paths of the project files to which the debugger can connect (do not worry about the port remaining standard on this screen).

+1
source share

I know this is an old post, but it seemed like the one I ran into tonight.

Configuring NAT Network is the way to get the least amount of conflict. In the Windows 7 firewall, configure a custom inbound traffic rule to allow inbound traffic to port 9000 for the entire / 24 network that hosts the virtual machine (192.168.202 / 24).

My working XDebug setup in php.ini using 2.2.7 with Netbeans 8.0.2 :

 zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_connect_back=1 xdebug.remote_port=9000 xdebug.idekey="netbeans-xdebug" xdebug.show_local_vars=0 ;xdebug.extended_info=1 xdebug.output_buffering=off xdebug.remote_log=/var/log/xdebug.log 

Finally, I want to indicate that Netbeans is listening for the remote address setting in the remote file configuration . Running a quick netstat -an showed that Netbeans was listening on port 9000 with the status CLOSE_WAIT at the old address from my initial network setup. Even after changing the project URL and the IP address of the remote connection and closing multiple xdebug connections, this never changed. Only after Netbeans closes does a legacy connection reset. After starting Netbeans, the new remote server URL is used to remotely connect xdebug.

Mentioning Netbeans containing an outdated state has never been discussed, and the ability to stop the xdebug connection from the IDE gives a false sense of socket reset.

If it still does not work, use the provided debugclient in the virtual machine, go to the project page with "? XDEBUG_SESSION_START = netbeans-xdebug" added to the index.php URL and look at the xdebug information to enter. At least you know that it works locally.

+1
source share

Try setting any breakpoint to the executed script. A debugging session may not be displayed until ide complies with the "break at first line" flag.

Also check if the xdebug.idekey property in php.ini is ideKey in the Netbeans settings.

0
source share

All Articles