vscode-php-debug icon indicating copy to clipboard operation
vscode-php-debug copied to clipboard

How to specify ipv4 interface?

Open chibamap opened this issue 9 years ago • 2 comments

PHP version: 5.4.45 XDebug version: 2.2.3 Adapter version:

Your launch.json:
{ "log": true, "name": "Listen for XDebug", "type": "php", "request": "launch", "port": 9000, "stopOnEntry": true, "serverSourceRoot": "/opt/xxxxx/htdocs", "localSourceRoot": "${workspaceRoot}/xxxx/htdocs" },

XDebug php.ini config:
zend_extension="/usr/lib64/php/modules/xdebug.so"

[XDebug] xdebug.remote_enable=1 xdebug.remote_port="9000" xdebug.remote_autostart=1

XDebug logfile (from setting xdebug.remote_log in php.ini):
Adapter logfile (from setting "log": true in launch.json):
<- launchResponse Response { seq: 0, type: 'response', request_seq: 2, command: 'launch', success: true }


I want run on docker environment. They belongs ipv4 docker networks. But VS code debugger alway listen ipv6 interface. How to specify ipv4 interface?

$ lsof -i :9000
COMMAND     PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Code\x20H 56215 me   29u  IPv6 0xd236aa8673922e2f      0t0  TCP *:cslistener (LISTEN)

chibamap avatar May 09 '17 05:05 chibamap

I only specify the port to listen on, the host defaults to localhost, on whatever interface is the default: https://github.com/felixfbecker/vscode-php-debug/blob/master/src/phpDebug.ts#L265

You should be able to connect to that over IPv4, e.g. telnet 127.0.0.1 should work just like telnet ::1

felixfbecker avatar May 09 '17 07:05 felixfbecker

@felixfbecker thanks for reply. it was my misunderstanding. I might my trouble has other cause. I'll continue to investigate.

chibamap avatar May 10 '17 01:05 chibamap