question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xdebug host is not discovered correctly

See original GitHub issue

Describe the bug When XDEBUG_ENABLE: "true" is specified, the xdebug. remote_host is always set to 172.22.0.1.

Running the command from https://github.com/amazeeio/lagoon/blob/master/images/php/fpm/entrypoints/60-php-xdebug.sh#L6 after container started returns correct results.

It looks like the timeout is too low to get this command running correctly during container starting.

To Reproduce Steps to reproduce the behavior on MacOS:

  1. Set XDEBUG_ENABLE: "true" in docker-compose.yml.
  2. docker-compose up -d --build
  3. Create a page with phpinfo() and run it.
  4. Check the value of xdebug.remote_host. It will be 172.22.0.1.

Expected behavior The value of xdebug.remote_host should be docker.for.mac.localhost.

It is possible to override this by setting DOCKERHOST: "docker.for.mac.localhost" in docker-compose.yml, but this defeats the purpose of the auto-discovery mechanism in https://github.com/amazeeio/lagoon/blob/master/images/php/fpm/entrypoints/60-php-xdebug.sh.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
fubarhousecommented, Nov 8, 2019

I’ve got a commit ready to support the changes @Schnitzel has raised.

1reaction
smlxcommented, Nov 8, 2019

Just wanted to note, host.docker.internal should be supported on linux soon too via https://github.com/moby/moby/pull/40007

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xdebug host is not discovered correctly · Issue #1088 - GitHub
When XDEBUG_ENABLE: "true" is specified, the xdebug. remote_host is always set to 172.22.0.1 . Running the command from https://github.com/amazeeio/lagoon/blob/ ...
Read more >
Xdebug for remote server not connecting - Stack Overflow
For the record, I have successfully installed Xdebug locally on a Windows 7 machine running WampServer. So I can debug PHP with breakpoints...
Read more >
Documentation » Step Debugging - Xdebug
Xdebug's step debugger allows you to interactively walk through your code to debug control flow and examine data structures.
Read more >
Documentation » Description of errors - Xdebug
Occurs when Xdebug is trying to connect to a debuging client to start a debugging session. The debugger could not make a connection...
Read more >
Documentation » Installation - Xdebug
This section describes on how to install Xdebug. How you install Xdebug depends on your system. There are the following possibilities:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found