Answer the question
In order to leave comments, you need to log in
Where is the problem when setting up xdebug on a remote docker machine?
Hello
, there is a test project (one index.php file)
rises in the docker on vps (ubuntu) (remote server)
here is the compose config
version: '3.1'
services:
webserver:
build:
context: docker
dockerfile: nginx/Dockerfile
working_dir: /application
volumes:
- './:/application'
ports:
- '180:80'
php-fpm:
build:
context: docker
dockerfile: php-fpm/Dockerfile
working_dir: /application
volumes:
- './:/application'
environment:
PHP_IDE_CONFIG: "serverName=example"
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.18.0.0/16
"Gateway" : "172.18.0.1",
"IPAddress" : "172.18.0.2",
xdebug.idekey=PHPSTORM
xdebug.mode=debug
xdebug.client_host=172.18.0.1
xdebug.remote_port=9003
Creating socket for '172.18.0.1:9003', poll success, but error: Operation in progress (29).
Could not connect to debugging client. Tried: 172.18.0.1:9003 (through xdebug.client_host/xdebug.client_port) :-(
❯ netstat -nat | grep 9003 | grep LISTEN
tcp46 0 0 *.9003 *.* LISTEN
~/projects/simple$ netstat -an | grep 9003
tcp 0 0 127.0.0.1:9003 0.0.0.0:* LISTEN
ssh -g -L 9003:localhost:9000 -f -N 127.0.0.1
ssh -R 9000:localhost:9000 vps -v
debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen localhost port 9000, originator 127.0.0.1 port 59934
debug1: connect_next: host localhost ([127.0.0.1]:9000) in progress, fd=9
debug1: channel 1: new [127.0.0.1]
debug1: confirm forwarded-tcpip
debug1: channel 1: connection failed: Connection refused
setsockopt TCP_NODELAY: Invalid argument
debug1: connect_next: host localhost ([::1]:9000) in progress, fd=10
debug1: channel 1: connection failed: Connection refused
connect_to localhost port 9000: failed.
debug1: channel 1: free: 127.0.0.1, nchannels 2
debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen localhost port 9000, originator 127.0.0.1 port 59940
setsockopt TCP_NODELAY: Invalid argument
debug1: connect_next: host localhost ([127.0.0.1]:9000) in progress, fd=9
debug1: channel 1: new [127.0.0.1]
debug1: confirm forwarded-tcpip
debug1: channel 1: connection failed: Connection refused
setsockopt TCP_NODELAY: Invalid argument
debug1: connect_next: host localhost ([::1]:9000) in progress, fd=10
debug1: channel 1: connection failed: Connection refused
connect_to localhost port 9000: failed.
debug1: channel 1: free: 127.0.0.1, nchannels 2
Answer the question
In order to leave comments, you need to log in
I looked here when I did
https://onedev.net/post/326
there is also a topic with host.docker.internal (I have docker 20.10+) it should work, but I didn’t understand how it was and what,
I couldn’t find dns from inside the containers comparisons nowhere, what and how it should work and "crawl" to the host machine with docker - I did not understand
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question