skip to Main Content

I am trying to use Colima to run an apache-php docker container. My uni provides docker images derived from upstream ones configured for our course using docker-compose.

The container works as it should but I can’t get its Xdebug to connect to my PhpStorm.

This is what it says in the Xdebug log:

Creating socket for 'host.docker.internal:9003', poll success, but error: Operation now in progress (29).

This tells me absolutely nothing.

The setup is admittedly quite complex (x86 Apache ran via QEMU in Docker in Linux VM in macOS on ARM CPU) but I can do nc host.docker.internal 9003 from any docker container, so I have no idea why Xdebug isn’t able to reach my host. (Only works when the IDE is running and on no other ports, so it’s definitely connecting to PhpStorm.)

Any idea what could be going on here?

2

Answers


  1. Chosen as BEST ANSWER

    The problem is the uni's docker-compose.yml which configured the container with:

        extra_hosts:
          - "host.docker.internal:host-gateway"
    

    and apparently that can break host.docker.internal in some situations: https://github.com/docker/for-linux/issues/264#issuecomment-759737542

    The solution is to remove those two lines.


  2. On Colina, the IP address is hard coded to "192.168.5.2", so setting xdebug.client_host=192.168.5.2 should do the trick. There is now also an alias for it, called host.lima.internal.
    As per this documentation page.

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