Useful Docker (For Mac) Information
Docker.qcow2
size (there is an offical solution pending)screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
dd if=/dev/zero of=/mnt/docker/zero bs=4096
to fill zero bytes into the free space of the ext4 file system under Docker.qcow4, until the disk is fullrm /mnt/docker/zero
then all the free space of Docker.qcow2 would be filled with zeros/Applications/Docker.app/Contents/MacOS/qemu-img convert -O qcow2 Docker.qcow2 Docker2.qcow2
sudo ifconfig lo0 alias 10.254.254.254
xdebug.remote_host=10.254.254.254
cat ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/slirp/host
Then modify xdebug settings:
xdebug.remote_connect_back=0
xdebug.remote_host=[IP ADDRESS FROM host mentioned above]
I have got it working with following configuration:
; xdebug options for HHVM/PHP
xdebug.enable=1
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM"
xdebug.remote_host="192.168.1.5" ; My local network IP, which is accessiable inside the container
xdebug.remote_port=9089
fastcgi_param REMOTE_ADDR "192.168.1.5"; #My local network IP
Make sure to restart the containers after these.
Now goto PHPStorm Preferences -> Languages and Frameworks -> PHP -> Debug
:
In the Xdebug section, set Debug port to 9089 and Can accept external connections should be checked. Now, click on the phone icon in top right corner in PHPStorm that has caption of Start listening for PHP debug connections.
You may want to restart PHPStorm and should have XDebug Helper16 installed and its IDE Key set to PHPSTORM.
Happy debugging :slight_smile: