skip to Main Content

I have now switched everything to Docker. The containers are loaded and I have reorganized my projects.

Sample my docker-compose.yaml:

version: '2'
services:
  php:
    container_name: php2
    image: tamuarchi/yii2-mssql:latest
    volumes:
      - ~/.composer-docker/cache:/root/.composer/cache:delegated
      - ./:/app:delegated
    ports:
      - '80:80'
    links:
      - db
    networks:
      mynetwork:
        aliases:
          - web2
    environment:
      XDEBUG_CONFIG: remote_host=host.docker.internal
  db:
    container_name: sql-server-db2
    image: mcr.microsoft.com/mssql/server:2017-latest
    volumes:
      - ./mssql-data/backup:/var/opt/mssql/data/backup
    ports:
      - "1433:1433"
    networks:
      mynetwork:
        aliases:
          - sql-server-db2
    environment:
      SA_PASSWORD: 'SUPERP@SSW0RD'
      ACCEPT_EULA: 'Y'

  memcached:
    container_name: memcached2
    image: memcached:latest
    ports:
      - "0.0.0.0:11211:11211"
volumes:
  my-db:
networks:
  mynetwork:
    driver: bridge

php.ini
Xdebug

1) I installed the listener in Chrome

2) I’m launching the containers from PhpStorm

Xdebug is not found or PhpStorm does not stop at the breakpoints. If I run into an error, I also have to restart the container to continue (even if the error is fixed).

2

Answers


  1. Chosen as BEST ANSWER

    What a bummer. In checking the file path... It struck me right away: xdebug.port = 9005. Listener set and lets go!

    Now the debugger opens at the breakpoint. Unfortunately it does not stop, but there are following errors in the console:

    16:49   Debug session was finished without being paused
                It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
                To figure out the problem check path mappings configuration for 'localhost' server at PHP|Servers or enable Break at first line in PHP scripts option (from Run menu).
    

  2. The problem is solved!

    ‘Break at first line….’ was still activated in the settings.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search