Unable to instantiate xdebug
See original GitHub issueHello,
I have hard time to instantiate xdebug for proophessor-do.
I have cloned the project and added it to Phpstorm projects in order to be able to put some break-points and see exactly the route it takes for each functionality in order to better understand prooph components.
for docker-compose.yml
I changed the php
section into this:
php:
image: prooph/php:7.1-fpm-xdebug
volumes:
- .:/var/www
depends_on:
- mysql
- mongodb
environment:
- PROOPH_ENV=development
- XDEBUG_CONFIG="remote_host=192.168.1.9"
- PHP_IDE_CONFIG="serverName=Prooph-docker"
everything else is default
For the phpstorm part:
Run/Debug Configurations (docker)
Run/Debug Configurations (PHP Remote Debug) I have tried also with checked Filter… checkbox
my ifconfig
result:
~ $ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
XHC0: flags=0<> mtu 0
EHC250: flags=0<> mtu 0
EHC253: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
ether c4:2c:03:24:83:a0
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (none)
status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 60:33:4b:0b:61:83
inet6 fe80::cc9:38d4:7cf:1b54%en1 prefixlen 64 secured scopeid 0x8
inet 192.168.1.9 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 02:33:4b:0b:61:83
media: autoselect
status: inactive
fw0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 4078
lladdr e8:06:88:ff:fe:f0:eb:0e
media: autoselect <full-duplex>
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::249a:d86c:ab3e:6e1a%utun0 prefixlen 64 scopeid 0xb
nd6 options=201<PERFORMNUD,DAD>
When I run Docker
from PhpStorm:
When I run the debugger from PhpStorm:
And still, breakpoints are getting ignored…
I probably miss something on the way, but I’m not sure what is it.
This is my phpinfo() for the xdebug section:
And this is the Environment section from phpinfo()
I saw here that the IDE Key is set on www-data, and I set www-data as the IDE key to listen for in PhpStorm, but still nothing happened…
Also, it is my first time using docker, I never used it before. I used to use virtual box for mac, and my remote debug worked fine, so I guess the steps to follow with docker are more or less the same… no?
As @codeliner suggested I’m pinging @sandrokeil on this.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (6 by maintainers)
Top GitHub Comments
Hi,
For me it was hard to set it up too, because of the configuration of the remote connection. I use
php:7.1-fpm
, but I suppose it will be similar for you.This is my configuration:
.env
file:The relevant part of my
docker-compose.yml
file, the one that refers to the PHP container:And the relevant part of my
Dockerfile
:Then, my xdebug configuration in PHPStorm is as follows:
The configuration for xdebug:
And the configuration for server —it is a Symfony 3.4 application, it may differ for you—:
Hope it helps!
Regards!
@rubenrubiob Thank you for the comment!
I was about to try that today, as I said to @codeliner in Gitter yesterday, building xdebug from pecl should do the trick and you prove me correct as it works now!
Thanks again @rubenrubiob for taking the time to help!
I didn’t changed anything from my previous settings, all I did was changing my
docker-compose.yml
and addDockerfile
and then run$ docker-compose up -d
and xdebug now works fine!./docker-compose.yml
file (only php section):./Dockerfile
:et voilà! xdebug now works! 😃