Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDebug => PhpStorm connection is not working on Mac OS X #179

Closed
spoonerWeb opened this issue Jun 22, 2017 · 8 comments
Closed

XDebug => PhpStorm connection is not working on Mac OS X #179

spoonerWeb opened this issue Jun 22, 2017 · 8 comments

Comments

@spoonerWeb
Copy link

spoonerWeb commented Jun 22, 2017

This issue exists when using Docker for Mac!
You need to do following steps:

  1. Follow the instructions on https://www.ashsmith.io/docker/get-xdebug-working-with-docker-for-mac/ to create an alias for localhost with the IP 10.254.254.254
  2. Add the line xdebug.remote_host = 10.254.254.254 to the development.ini
  3. Set xdebug.remote_connect_back = Off in the development.ini
  4. make rebuild
  5. Setup PhpStorm like mentioned in the documentation
  6. Additionally go to PhpStorm => Settings => Languages & Frameworks => PHP => Debug => DBGp Proxy and set Host to the IP 10.254.254.254 and Port 9001

Hope, this helps others with that issue.

@josefglatz
Copy link
Member

This is just necessary when using Docker for Mac? Because I have no problems using XDebug without configuration

@spoonerWeb
Copy link
Author

Yes, with Docker for Mac!

@stucki
Copy link
Contributor

stucki commented Jun 22, 2017

The problem is that the Docker container runs on a VM which does not (seem to) allow connections to the host. When you browse the website, Nginx or Apache think that you are and therefore the connection to your host (where PhpStorm is running) does not work.

@dmitryd
Copy link

dmitryd commented Aug 14, 2017

To make it work you adjust etc/php/development.ini as follows:

xdebug.remote_connect_back = off
xdebug.remote_host = docker.for.mac.localhost

See this for the official Docker information on the matter.

@josefglatz
Copy link
Member

@spoonerWeb Does the problem still exist?

@SmithysHub
Copy link

Macos also needs a native proxy - Try this on macos side:
sudo ifconfig en0 alias 10.254.254.254 255.255.255.0

@kkugelmann
Copy link

If you use xdebug.remote_host = host.docker.internal instead the configuration is working for all platforms 👍

@htuscher
Copy link
Member

In addition, if you use a nginx reverse proxy, you'll need to override this:

proxy_set_header X-Forwarded-For "host.docker.internal";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants