I have a docker-compose file which mounts a folder containing my client and server projects:
volumes:
- ~/projectx:/projectx
my docker php.ini contains the following xdebug options
[xdebug]
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_connect_back=On
xdebug.var_display_max_children = 999
xdebug.var_display_max_data = 999
xdebug.var_display_max_depth = 100
I have the xdebug chrome extension installed
In my mac host file I have the following 127.0.0.1 localhost dtest.xxx.com so I can access my web app (and other docker web apps) through dtest.xxx.com which all works to run the app
In Phpstorm (version 2016.1.2) In preferences -> Languages & Frameworks -> PHP -> Servers I have :
host = dtest.xxx.com,
port=80 ,
Debugger = Xdebug
Use path mappings is checked and I have
File/Directory set to /Users/<myname>/projectx/server
Absolute path on the server is set to /projectx/server
I have tried setting the xdebug.remote_host to my macs ip obtained from ifconfig as well as trying the ip in /Users//Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/slirp/host
But I cannot hit a breakpoint , I have even added xdebug_break() to double check.
I would very much appreciate anyone’s help, it’s a real blocker for me.
If any further information is required I am happy to provide.
Information
The output of Diagnose & Feedback` on OSX:
Docker for Mac: version: mac-v1.12.0-beta18-3-gec40b14
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160707-154924.tar.gz
[OK] docker-cli
[OK] app
[OK] menubar
[OK] virtualization
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux
This was also posted on stackoverflow