Closed sidneywidmer closed 3 years ago
@sidneywidmer I see where this is an issue and will get resolved with the next release! Sorry about that.
The Xdebug documentation can be a little hard to read but the environment variable takes precedence.
@sidneywidmer looking into this, does the host host-gateway
resolve while inside a container using nitro ssh --root
(ping
is not available as the www-data
user)?
No, this is just a special string that gets resolved to the hosts IP if used in the --add-host
parameter. Just to double check i tried to ping it (as root) and as expected I get ping: bad address 'host-gateway'
. Together with said add-host param it can be used to make host.docker.internal
as domain name available inside docker containers on linux.
Thanks for fixing the issue - I just tested it out and I could successfully debug with phpstorm :+1:
Keep up the good work, I really like the direction this project is going :rocket:
Description
Currently xdebug does not work on linux since xdebug.client_host is hardcoded to
host.docker.internal
which does not exist in docker for linux.Since docker version 20.10 it's possible to add it manually: https://github.com/docker/for-linux/issues/264#issuecomment-714253414 so this could potentially be a simple fix.
I also tried to overwrite it in a custom .user.ini which didn't work (maybe the ENV var gets priority?).
Steps to reproduce
nitro ssh
./craft
-->Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-(
Additional info
It would be nice if there was a simple way to set custom env vars, preferably in the nitro.yaml but i think this is a different issue :)