Search code examples
phpstorm

PhpStorm cannot start Xdebug (to work with Docker)


I'm running PhpStorm on Ubuntu 16.04 and trying to configure Xdebug to work with Docker. And I followed this guide:

Zero-configuration Web Application Debugging with Xdebug and PhpStorm

Here's step I did:

Download the Docker Xdebug project source code provided by JetBrains

Edit Xdebug remote host:

Edit Xdebug remote host

Configure DBGp Proxy (under Language & Framework => PHP => Xdebug) as following:

DBGp Proxy

Edit Run/Debug Configuration

Run/Debug Configuration

Run/Debug Configuration

Edit Build, Execution, Deployment for Docker

Build, Execution, Deployment

Start Docker

Start Docker

Enable Listening Xdebug Connection

Listening Xdebug Connection

Check Xdebug info

Xdebug info

But somehow, I cannot start the Xdebug button (as you can see in the above photo).

What did I do wrong?


Solution

  • Somehow the docker container cannot access port 9000 on host machine. By running the following command I fixed the problem:

    # iptables -I INPUT -p tcp -m tcp --dport 9000 -j ACCEPT