Docker Community Forums

Share and learn in the Docker community.

Docker and xDebug are Connecting but don't hit breakpoints in phpstorm on Windows (Solved)


#1

Hello!

docker-compose:

version: '3'
services:
  nginx:
    image: nginx:latest
    ports:
      - 80:80
    volumes:
      - ./app:/var/www
      - ./docker/nginx/conf.d:/etc/nginx/conf.d
      - ./docker/nginx/logs:/var/log/nginx/
    depends_on:
      - php
  php:
    build: ./docker/php
    environment:
      PHP_IDE_CONFIG: "serverName=php-docker.local"
    volumes:
      - ./app:/var/www
      - ./docker/php/php.ini:/usr/local/etc/php/php.ini
      - ./docker/php/logs:/var/log
    depends_on:
      - db
    working_dir: /var/www

  db:
     image: mysql:latest
     command: --default-authentication-plugin=mysql_native_password
     environment:
       MYSQL_DATABASE: game
       MYSQL_ROOT_PASSWORD: password
       MYSQL_USER: game
       MYSQL_PASSWORD: game
     volumes:
       - ./db_data:/var/lib/mysql

  phpmyadmin:
      image: phpmyadmin/phpmyadmin
      ports:
        - 8000:80

xdebug.ini:

[xdebug]
xdebug.remote_enable=true
xdebug.remote_host=host.docker.internal
xdebug.remote_connect_back=0
xdebug.remote_log=/var/log/xdebug.log

The first breakpoint (it was set in phpstorm debug settings) is ok. But my breakpoint doesn’t work. If I click step over, nothing happens:

Path mappings is ok. Debug validator tells all is well.

Why doesn’t breakpoint work?


#2

Solved it. Just downgraded to xdebug version 2.6.