2

My OS is Windows 10. I've run Docker via the boot2docker image. IDE I use is PHPStorm. What I want to do is debug with XDebug, but I don't get it running. I searched the Web and tried the examples I found but nothing helps. Is there anyone with the same architecture who can help me?

Edit: Nginx ist running on the server.

Current setup: xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.idekey=PhpStorm

PhpStorm server Host is same IP I connect for SSH. Path mappings is enabled. Debugger is Xdebug I tried already with a specific DBPg Proxy but no success

messy
  • 915
  • 6
  • 26
  • 1
    duplicate of http://stackoverflow.com/questions/30594804/remote-debugging-with-xdebug-from-inside-a-docker-container-does-not-work ? See also https://hub.docker.com/r/tommylau/xdebug/ and http://rockhopper.dk/linux/docker-and-php-xdebug/ – user2915097 Sep 19 '15 at 12:56
  • Also: https://devnet.jetbrains.com/message/5534075#5534075 for initiating run/debug CLI scripts inside docker container from IDE – LazyOne Sep 19 '15 at 13:00
  • All of those sites I have already tried. No success. I googled a lot before I asked. – messy Sep 19 '15 at 13:25
  • can you elaborate on your `I don't get it running.` ? – user2915097 Sep 19 '15 at 13:45
  • I would like to do that, but I don't know what to say. It is just not working. XDebug is installed, xdebug.ini is set, PHPStorm is configured and breakpoints are set. But it happens just nothing. I tried different setups. I post my current on my question. – messy Sep 19 '15 at 13:53

3 Answers3

4

I got it. I just forgot to forward the port. I've to run the container via docker run -d -p 80:80 -p 9000:9000 -v /mnt/www/foo:/var/www/foo foo.

messy
  • 915
  • 6
  • 26
1

php.ini

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
; Set to host.docker.internal on Mac and Windows, otherwise, set to host real ip
xdebug.remote_host = host.docker.internal
xdebug.remote_port = 9000
xdebug.remote_log = /var/log/php/xdebug.log
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Tinywan
  • 31
  • 3
0

I used the following setting in ini file:

xdebug.remote_connect_back=0
xdebug.remote_host=host.docker.internal
Elia Weiss
  • 8,324
  • 13
  • 70
  • 110