0
votes

I am a little bit blocked here. I am using Ubuntu 14 machine with Atom, where I am developing a Drupal-based system. The installation of the system is on a docker container that I run over a VM using Vagrant. I can operate perfectly with Atom and run the local server to check changes. The problem is that using kint/dump is not enough, so I decided to install xdebug on docker container and php-debbuger on host machine. I also installed "The easiest Xdebug" on Firefox. But, they don't seem to get connected.

I followed this steps so far:

  • From docker
    • pecl install xdebug
    • inserted on php.ini

      zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so

    • inserted on xdebug.ini

      xdebug.remote_enable=1 xdebug.remote_autostart=0 xdebug.remote_connect_back=1 xdebug.remote_port=9000 xdebug.remote_log=/tmp/php5-xdebug.log xdebug.remote_handler=dbpg

  • From host machine, on ../provision/docker-compose.yml, added the following:

    environment:
    XDEBUG_CONFIG: remote_host={{192.168.33.33}}

  • At firefox's add-on, set the IDE key as

    xdebug.atom

  • From Atom, on php-debug - settings - Path Maps

    /url;/home/myname/www/path/cms/

I am confused with the last one, but I tried different approaches and I am sure there are other settings to do. What am I missing?

2

2 Answers

0
votes

My experience with Docker and XDebug is that you have to put your IP address in the Docker network.

Do a docker inspect [your_container_name] | grep -i gateway (when it's running) and use that IP for the remote host configuration in the xdebug.ini file.

If you want to debug further I recommend putting the remote host configuration directly in the xdebug.ini to make sure that the enviroment variable is being passed correctly.

0
votes

After installing php-debug, put below setting into your Atom config (config.cson):

"*":
  "php-debug":
    PathMaps: [
      "/path/to/app/in/docker;/path/to/app/in/local"
    ]
    ServerPort: 9000
  welcome:
    showOnStartup: false

To get more information and instructions, you can read this post.