Update Xdebug configuration instructions for Linux to support Docker 20.10+ #9887
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the issues discussed in this thread regarding the Linux Host IP Configuration for Xdebug in the Laravel documentation.
Why the change is necessary:
Docker 20.10+: As outlined in the merge request,
host.docker.internal
became available on Linux starting with Docker 20.10. This means Linux users no longer need to manually configure the host IP, simplifying Xdebug configuration.Incorrect Documentation for Docker 17.06+: The previous documentation incorrectly suggested that Docker 17.06.0+ would resolve the issue for Linux users, but
host.docker.internal
was not supported on Linux until Docker 20.10. Users still had to manually set the host IP even with Docker 17.x.Pre-Docker 20.10: For older Docker versions, the current suggestion to use docker inspect to find the IP is impractical. Each time the container restarts, the IP changes, so users would need both "foreteller skills" to predict the new IP and manually update it each time—which is cumbersome and error-prone.
By configuring a static IP in
docker-compose.yml
, this PR ensures a consistent setup for older Docker versions, while also helping users on modern Docker versions avoid getting lost in a complicated setup they no longer need.These changes correct outdated instructions and simplify the process for Linux users across different Docker versions, offering a more reliable and user-friendly Xdebug setup.