I want to ask about debugging Yii 1.1 applications. I've tried implementing the answers on StackOverflow and other websites, but my VSCode still can't debug the application, the breakpoints that have been set are never read at all. I am using Docker to run Yii.
Here are the details of the file I used.
docker-compose.yml
version: '3'
services:
web:
container_name: php72
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:80"
volumes:
- ./:/var/www/html
- ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
networks:
- app-network
mysql:
image: mysql:8.0.31-oracle
restart: always
environment:
MYSQL_ROOT_PASSWORD: '123456'
MYSQL_USER: 'admin'
MYSQL_PASSWORD: '123456'
MYSQL_DATABASE: 'test_db'
volumes:
- db_data:/var/lib/mysql
ports:
- 3306:3306
networks:
- app-network
networks:
app-network:
volumes:
db_data:
Dockerfile
FROM php:7.2-apache
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions gd xdebug pdo pdo_mysql pdo_pgsql mongodb mbstring zip
EXPOSE 80
xdebug.ini
zend_extension=xdebug
[xdebug]
xdebug.mode=debug
xdebug.discover_client_host=1
xdebug.idekey=VSCODE
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.remote_host="host.docker.internal"
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:8001"
],
"program": "",
"cwd": "${workspaceRoot}/../../",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
And here is my project structure:
I access my apps in a browser with localhost:8000, then I try to turn on the VSCode debugger, but this is the result:
Any help is very much appreciated.
Is there any missing configuration?
After watching several videos on how to setup Xdebug for an application running inside a docker container, I finally found the answer that works for my case.
I changed my docker-compose.yml to be like this:
version: '3'
services:
web:
container_name: php72
build:
context: .
dockerfile: Dockerfile
extra_hosts:
- "host.docker.internal:host-gateway" // Add extra host for docker
ports:
- "8000:80"
volumes:
- ./:/var/www/html // this is the remote path where my apps installed
- ./xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
networks:
- app-network
mysql:
image: mysql:8.0.31-oracle
restart: always
environment:
MYSQL_ROOT_PASSWORD: '123456'
MYSQL_USER: 'admin'
MYSQL_PASSWORD: '123456'
MYSQL_DATABASE: 'wms_test'
volumes:
- db_data:/var/lib/mysql
ports:
- 3306:3306
networks:
- app-network
networks:
app-network:
volumes:
db_data:
And as per as #LazyOne advise, since I am using Xdebug 3 I have change my xdebug.ini also to be like this:
zend_extension=xdebug
[xdebug]
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.client_host=host.docker.internal
xdebug.idekey="VSCODE"
xdebug.log=/tmp/xdebug_remote.log
And the important part, after watching this YouTube video Setup Xdebug WITH DOCKER and debug in VSCode I've figured out what is missing in my previous setup, and that is the pathMapping. So I've changed my launch.json to be like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html" : "${workspaceFolder}"
}
}
]
}
And voila that work like a charm:
Related
I've set up a new laravel project and here's the step I followed :
install laravel on docker using
curl -s "https://laravel.build/example-app" | bash
changing mysql port as 3306 is already used in my machine. Files have changed
.env file
DB_CONNECTION=mysql
DB_HOST=0.0.0.0
DB_PORT=4306
DB_DATABASE=example_app
DB_USERNAME=sail
DB_PASSWORD=password
docker-compose file (mysql container section)
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-4306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- 'sail-mysql:/var/lib/mysql'
- './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
networks:
- sail
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 3
timeout: 5s
build and run container
./vendor/bin/sail up
run 1st migration
Everything works fine at this point.
Then I install breeze package and run the migration
composer require laravel/breeze && php artisan migrate
Everything is still working at this point.
Then when I try to register a new user entering the adress localhost/register, I get the following error
lluminate \ Database \ QueryException
SQLSTATE[HY000] [2002] Connection refused
select count(*) as aggregate from `users` where `email` = my_new_user#test.com
Am I missing something in the .env or the docker-compose.yml ?
Thanks a lot
I found a fix by changing the environment variable with the Gateway IP
Use this command to find this IP
docker network inspect bridge
you should have a result like the following :
[
{
"Name": "bridge",
"Id": "17da7215587ae714f631d213fed173550b69d38a5824c1998e1c3cd4b2e954b",
"Created": "2022-10-26T19:26:38.585884296Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
use the Gateway entry in your .env file
I'm trying to create a docker container with PHP and Xdebug to use step debugging. I use VSCode and somehow this debugger it's not working.
Apparently the Dockerfile is not been executed when I use docker compose up -d command. I assume that is because in the file it has a COPY command to copy a file (called 90-xdebug.ini) from my project to a specific directory. And after the container is up, I check the directory and the file isn't there... then I have to execute the commands in Dockerfile manually.
Anyways, after installing, I know that the installation worked because the xdebug_info() function works. But I don't know why VSCode can't debug it.
My OS is Ubuntu 20.04.5 LTS; Dockerfile, docker-compose.yml and 90-xdebug.ini are in project's root.
My Dockerfile:
FROM php:7.4-apache
COPY 90-xdebug.ini "/usr/local/etc/php/conf.d"
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
90-xdebug.ini:
xdebug.mode=debug
xdebug.discover_client_host=0
xdebug.client_host=host.docker.internal
docker-compose.yml:
services:
php-apache:
container_name: php-apache
image: php:7.4-apache
build:
context: .
dockerfile: Dockerfile
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./:/var/www/html/
working_dir: /var/www/html/
ports:
- 3003:3003
entrypoint: "php -S 0.0.0.0:3003"
launch.json inside ".vscode" directory:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
Extra information:
this is my program and i've put a break point on "$var = "txt1" " line, but it runs directly towards "xdebug_info()"
<?php
function fprint(string $str):void{
echo $str;
}
$var = "txt1";
fprint($var);
$var = "txt2";
fprint($var);
$var = "txt3";
fprint($var);
// echo $PHP_INI_DIR;
// echo phpinfo();
xdebug_info();
As you say (in a comment) that xdebug_info() shows that you had an active debugging connection, then that means that the debugger works. What is likely happening here is that:
you don't have any breakpoints set - in which case the debugger never breaks
more likely, that you do have a breakpoint set, but that you don't have a path mapping configured, that maps a path from inside the container (/var/www/html) to your local project route, which you can refer to with "${workspaceRoot}/html". You need to tell VS Code this path mapping by making the following configuration:
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceRoot}/html",
}
},
I might not have gotten the exact right paths in this configuration. If you tell Xdebug to make a log file (-dxdebug.log=/tmp/xdebug.log and -dxdebug.log_level=10) it will create a log file in your container, where the contents tell you which breakpoint file name is tried to be matched against the files that PHP sees, something like:
[11] [Step Debug] DEBUG: I:
Matching breakpoint '/home/caio/dev/project/html/info.php:1'
against location '/var/www/html/info.php:2'.
If these paths don't match, adjust your path mappings.
I'm trying to configure a WordPress development environment with docker-compose and Xdebug but I can't get the debugger to work with a simple break point on info.php file after starting my debugging session in VSCode.
Here are my configs:
dockerfile
FROM php:7.4-apache
RUN docker-php-ext-install mysqli
RUN pecl install xdebug
php.ini
zend_extension=xdebug.so
xdebug.profiler_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9003
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.idekey=VSCODE
docker-compose.yml
version: "3.9"
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
build: .
volumes:
- ./wp:/var/www/html
- ./php.ini:/usr/local/etc/php/php.ini
ports:
- "80:80"
restart: always
environment:
PHP_EXTENSION_DEBUG: 1
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data: {}
wp: {}
.vscode/launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html":"${workspaceFolder}/wp"
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "Launch Built-in web server",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
I followed this tutorial with the exact same steps and still not able to do step debugging.
I had the same problem as you
For my case, put those config in the ini is not enough, I need to put the xdebug config into docker-compose.yml, it looks like:
services:
Wordpress:
...
environment:
XDEBUG_CONFIG: remote_host=host.docker.internal remote_port=9003 remote_enable=1
xdebug 2.7.0, php 7.0, visual code 1.72.1 (php debug ext v1.29.0)
I want to configure VS Code Xdebug plugin to work with Xdebug inside a WordPress Docker container.
I have an issue with the ports.
If I specify on the WP-with-Xdebug container in the "ports" section of the docker-compose.yml file:
- "9009:9000"
And in the environment variable XDEBUG_CONFIG on the same container:
XDEBUG_CONFIG: remote_host=172.17.0.1 mode=debug start_with_request=true client_port=9000
Then in the launch.json file of the VS Code plugin config I put this line:
"port": 9009
Then, when I run docker-compose down and then docker-compose up, I see that the docker-compose up log is good, no errors are in it. Then I click on the green Play icon before the option "Listen for Xdebug" I get the message box with:
listen EADDRINUSE: address already in use :::9009
I think that both the WP container with Xdebug in it and the VS Code plugin want to use the same port on the host 9009 to do the same think, send information to one another, but I do not understand why they do not succeed.
I did not put here the output of phpinfo() because it contains sensible information.
I use:
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug
https://github.com/xdebug/vscode-php-debug
wpdiaries/wordpress-xdebug:latest Docker image (https://hub.docker.com/r/wpdiaries/wordpress-xdebug or https://github.com/wpdiaries/wordpress-xdebug)
Xdebug v3
latest stable version of WordPress and PHP v8.0.3
I did not try a lot but a little of this: https://github.com/mac-cain13/xdebug-helper-for-chrome and I don't think it helps me in this issue.
This is a filtered version of my docker-compose.yml:
version: '3.3'
services:
db:
container_name: "db_1"
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: "no"
environment:
MYSQL_DATABASE: "wordpress"
MYSQL_USER: "root"
MYSQL_ROOT_PASSWORD: "9821379"
wordpress:
container_name: "wordpress_1"
depends_on:
- db
image: wpdiaries/wordpress-xdebug:latest
ports:
- "80:80"
- "9009:9000"
volumes:
- type: bind
source: ./html
target: /var/www/html
volume:
nocopy: true
restart: "no"
environment:
WORDPRESS_DB_NAME: "wordpress"
WORDPRESS_DB_USER: "root"
WORDPRESS_DB_PASSWORD: "9821379"
WORDPRESS_DB_HOST: db:3306
WORDPRESS_TABLE_PREFIX: 'wp_'
XDEBUG_CONFIG: remote_host=172.17.0.1 mode=debug start_with_request=true client_port=9000
phpmyadmin:
container_name: "phpmyadmin_1"
depends_on:
- db
restart: "no"
ports:
- "8080:80"
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: db:3306
PMA_USER: "root"
PMA_PORT: 3306
PMA_PASSWORD: "9821379"
volumes:
db_data: {}
This is my launch.json file:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9009,
"pathMappings": {
"/var/www/html": "${workspaceFolder}/html"
}
},
// the following is not used and not updated:
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003
}
]
}
Articles I've tried more or less:
https://dev.to/natterstefan/docker-tip-how-to-get-host-s-ip-address-inside-a-docker-container-5anh
https://dzone.com/articles/setup-wordpress-debug-environment-with-docker-and
https://www.wpdiaries.com/wordpress-with-xdebug-for-docker/#using-a-ready-made-image
I've rebooted my laptop and the same issue appears again.
Until I get a reaction to this post I think I will read the docs here: https://xdebug.org/docs/step_debug.
I think that both the WP container with Xdebug in it and the VS Code plugin want to use the same port on the host 9009
Yes, that nails it on the head. It is Xdebug that makes the connection, so there is no reason to expose the 9000/9009 port on the WordPress containers as that is for incoming connections. You can remove that expose line.
While setting up a php dev environment with docker, I ran into an issue while setting up remote debugging (XDEBUG) through a dbgp proxy.
Connecting my host machine to the proxy doesn't seem to be a problem, but the proxy container cannot reach my host machine over the port that is configured (in this case 9003)
I'm using docker compose on windows.
Sucessfully connecting my dev machine to the proxy:
INFO: dbgp.proxy: Server:onConnect ('172.18.0.1', 36558) [proxyinit -p 9003 -k XDEBUG_IDEA -m 1 ]
When executing a request containing the right IDE key (e.g. http://localhost/?XDEBUG_SESSION_START=XDEBUG_IDEA), the proxy reacts correctly but is unable to contact the gateway over the port that was registered by my dev machine)
INFO: dbgp.proxy: connection from 172.18.0.2:40902 [<__main__.sessionProxy instance at 0x7fcff1998998>]
ERROR: dbgp.proxy: Unable to connect to the server listener 172.18.0.1:9003 [<__main__.sessionProxy instance at 0x7fcff1998998>]
Traceback (most recent call last):
File "/usr/local/bin/pydbgpproxy", line 223, in startServer
self._server.connect((self._serverAddr[0], self._serverAddr[1]))
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused
WARNING: dbgp.proxy: Unable to connect to server with key [XDEBUG_IDEA], stopping request [<__main__.sessionProxy instance at 0x7fcff1998998>]
INFO: dbgp.proxy: session stopped
Any ideas on what is going wrong here?
Firewall issues can be excluded here, since i basically just turned it of.
I did log into the dbgpproxy container and was able to send requests to the gateway ip over ports 80 an 8080, but got the same connection refused when trying port 9003)
Any pointers would be greatly appreciated!
The docker compose file:
version: '2'
volumes:
mysqldata:
driver: local
services:
app:
restart: "always"
image: php:7.0-fpm
command: "true"
volumes:
- .:/var/www/html
nginx:
restart: "always"
build: ./docker/nginx/
ports:
- "80:80"
depends_on:
- php
php:
restart: "always"
build: ./docker/php/
environment:
XDEBUG_CONFIG: remote_host=dbgpproxy
expose:
- "9000"
depends_on:
- mysql
volumes_from:
- app
composer:
restart: "no"
image: composer/composer:php7
command: install
volumes:
- .:/app
dbgpproxy:
restart: "always"
image: christianbladescb/dbgpproxy
expose:
- "9000"
ports:
- "9001:9001"
environment:
DOCKER_HOST: 10.0.75.1
mysql:
image: mysql:latest
volumes:
- mysqldata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: project
MYSQL_USER: project
MYSQL_PASSWORD: project
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- 8080:80
depends_on:
- mysql
environment:
PMA_HOST: mysql
redis:
image: redis
ports:
- "6379:6379"
mailcatcher:
image: schickling/mailcatcher
restart: "always"
Docker network info:
[
{
"Name": "test_default",
"Id": "8f5b2e1188d65948d6a46977467b181e7fdb4b112a688ff87691b35c29da8970",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Containers": {
"05725540eca07666de250f2bb9ae856da69c0c325c4476150f214ba32a9b8714": {
"Name": "test_nginx_1",
"EndpointID": "723a820ea07e77cf976712293a911be3245e862477af6e0ecdcc1462536de6f5",
"MacAddress": "02:42:ac:12:00:08",
"IPv4Address": "172.18.0.8/16",
"IPv6Address": ""
},
"78085ebed911e767a9c006d909cb245e0392055d37550c6cfa3a618969bef821": {
"Name": "test_dbgpproxy_1",
"EndpointID": "2332e1a01a8c0ec7262d96829d7d8f3cb4c711b6e9033ab85a8dfdb57ae01382",
"MacAddress": "02:42:ac:12:00:0a",
"IPv4Address": "172.18.0.10/16",
"IPv6Address": ""
},
"7e12ea0a3a9b90360be6c15222fd052fbf02065aa18b8a3b12d19779bef4b41b": {
"Name": "test_phpmyadmin_1",
"EndpointID": "456a6508b6a507e01584beaf54eec9605db449261749065a562a6fb62111bb9c",
"MacAddress": "02:42:ac:12:00:05",
"IPv4Address": "172.18.0.5/16",
"IPv6Address": ""
},
"81043a642cd9932e16bc51ba4604f6057d82e2c05f6e7378a85adfaa2de87f28": {
"Name": "test_app_1",
"EndpointID": "cfa41a5f210d4907747dcf7d516c6bdaecb817c993867a1e5f8e0250d33c927b",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"8b0cd7dc33fb783ae811f7ba15decd0165199da66242a10a33d8ee86c41bd664": {
"Name": "test_mailcatcher_1",
"EndpointID": "f2ed38e42dffd9565822a7ac248dcb022a47c8a78b05e93793b62d7188d0823c",
"MacAddress": "02:42:ac:12:00:06",
"IPv4Address": "172.18.0.6/16",
"IPv6Address": ""
},
"d552bf1ab3914220b8fbf9961cc3801acbe180c6e945bd0b4c3bcf8588352a5d": {
"Name": "test_mysql_1",
"EndpointID": "6188cbeb49cf8afc2a7622bd6ef7fc7076ea91b909ec3efc1d9a1ed1d35d5790",
"MacAddress": "02:42:ac:12:00:04",
"IPv4Address": "172.18.0.4/16",
"IPv6Address": ""
},
"ecc941fc337d727e3c118bf9112dee1552ef5db7c94b24706c7d03bc42ea6c0a": {
"Name": "test_redis_1",
"EndpointID": "3f4254982ed1be8354f514dd717993e02b4afdfad8d022f5f8daf0b919a852e1",
"MacAddress": "02:42:ac:12:00:07",
"IPv4Address": "172.18.0.7/16",
"IPv6Address": ""
},
"f15f53405205db7263013fbb1ef1272764ca16850a46097b23d3619cd3d37b20": {
"Name": "test_php_1",
"EndpointID": "5fe30610823cd5660bf62e7612007ff4eef0316cbdfd15dbc0e56cafa6a3aca7",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
That's because pydbgpproxy works similar to XDebug and it is trying to connect to the wrong IP address. The correct IP address pydbgpproxy should connect to is host.docker.internal.
Situation:
xDebug ---> pydbgpproxy -X-> Host
This is because pydbgpproxy received the wrong IP from Docker in the first place.
So I guess you have to hardcode the host.docker.internal IP into pydbgpproxy