Skip to content
Michal Hošna edited this page Feb 9, 2018 · 3 revisions

Setting up xdebug in docker can be tricky.

Setting custom loopkback address

MacOs

Before starting docker-compose stack

ifconfig lo0 alias 10.254.254.254
export XDEBUG_REMOTE_HOST=10.254.254.254

Linux

(Not tested, somebody with linux please provide feedback)

  1. Setup network interface alias - https://www.cyberciti.biz/faq/linux-creating-or-adding-new-network-alias-to-a-network-card-nic/
  2. Set ENV XDEBUG_REMOTE_HOST to alias ip addr export XDEBUG_REMOTE_HOST=x.x.x.x

Windows

If you like to torture yourself, please be so kind, and write here how to do that. 😄

Port

Default port is changed to 9001, because default 9000 coliding with php-fpm and can sometimes do nasty things.

PHPstorm

  1. Change port: Preferences > Languages & Frameworks > PHP > Debug > Debug port: 9001
  2. Change server mapping:
    1. Go to Preferences > Languages & Frameworks > PHP > Servers
    2. Add new server with params:
      • Name: Whatever you like
      • Host: docker-dev
      • Port: doesn't matter actually
      • Use path mapping: true
    3. Map project folder to /src as Absolute path on the server

screen shot 2018-02-09 at 15 38 50

Clone this wiki locally