php - How to properly configure xdebug.client_host for Docker in Linux?Get the solution ↓↓↓
I am running a PHP server inside a Docker container on Linux (WSL2). I would like to connect Xdebug to this process, but can't find out which IP to use for this.
On Windows and Mac, the
xdebug.idekey=host.docker.internal variable automatically maps the correct IP, but AFAIK this isn't available in Linux.
I've tried manually inputting the IP from
ip show route and
hostname -I from both the host as well as the docker-container, but these don't work either (and would only be a temporary fix even if they did work).
My container also does not have a
docker0 network, which some tutorials want to use to connect, and I am not sure what that is or how I get one.
So the question is: how can I get the correct IP address and automatically set it in my configuration (docker-file, docker-compose or php.ini file)
Share solution ↓
Link To Answer People are also looking for solutions of the problem: illuminate\http\exceptions\posttoolargeexception
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.