How to specify ipv4 interface?
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)
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 thanks for reply. it was my misunderstanding. I might my trouble has other cause. I'll continue to investigate.