Skip to content

Commit

Permalink
Merge pull request #115 from progonkpa/add-xdebug-remote-host-ip
Browse files Browse the repository at this point in the history
Alleviate manual XDebug config by using new Docker DNS name.
  • Loading branch information
eko committed Oct 9, 2019
2 parents ad32f7c + 64f6e37 commit 34dba2b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -66,8 +66,9 @@ You can also use Kibana to visualize Nginx & Symfony logs by visiting `http://sy


# Use xdebug! # Use xdebug!


To use xdebug change the line `"docker-host.localhost:127.0.0.1"` in docker-compose.yml and replace 127.0.0.1 with your machine ip addres. Configure your IDE to use port 5902 for XDebug.
If your IDE default port is not set to 5902 you should do that, too. Docker versions below 18.03.1 don't support the Docker variable `host.docker.internal`.
In that case you'd have to swap out `host.docker.internal` with your machine IP address in php-fpm/xdebug.ini.


# Code license # Code license


Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Expand Up @@ -19,8 +19,6 @@ services:
- ./logs/symfony:/var/www/symfony/var/log:cached - ./logs/symfony:/var/www/symfony/var/log:cached
links: links:
- db - db
extra_hosts:
- "docker-host.localhost:127.0.0.1"
nginx: nginx:
build: ./nginx build: ./nginx
ports: ports:
Expand Down
2 changes: 1 addition & 1 deletion php-fpm/xdebug.ini
Expand Up @@ -3,4 +3,4 @@ zend_extension=xdebug.so
[Xdebug] [Xdebug]
xdebug.remote_enable=true xdebug.remote_enable=true
xdebug.remote_port=5902 xdebug.remote_port=5902
xdebug.remote_host=docker-host.localhost xdebug.remote_host=host.docker.internal

0 comments on commit 34dba2b

Please sign in to comment.