随分悩む、、、同じ症状で悩む人のサイトを発見
xdebugが”host.docker.internal”を引き当てられないらしく、”extra_hosts”を指定すると動いた
FROM php:8.2-apache
RUN pecl install xdebug && \
docker-php-ext-enable xdebug
RUN touch /var/log/xdebug.log && chmod a+w /var/log/xdebug.log
services:
web:
build: ./
extra_hosts:
- "host.docker.internal:192.168.10.180"
volumes:
- ./php/php.ini:/usr/local/etc/php/php.ini
- ./src:/var/www/html
ports:
- 8080:80
[xdebug] xdebug.client_host = host.docker.internal xdebug.mode = debug xdebug.start_with_request = yes xdebug.discover_client_host = 0 xdebug.remote_handler = "dbgp" xdebug.client_port = 9003 xdebug.log="/var/log/xdebug.log"
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceRoot}/src"
}
},