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 is not working on both mac and windows #26

Open
lamouf opened this issue Apr 1, 2020 · 7 comments
Open

xdebug is not working on both mac and windows #26

lamouf opened this issue Apr 1, 2020 · 7 comments

Comments

@lamouf
Copy link

lamouf commented Apr 1, 2020

Hi Paul,
I followed the exact steps in the two videos dedicated to xdebug.

  • i downloaded the laravel starter zip

  • copied .docker.env.example as .docker.env and changed the ip address

  • copied .env.example as .env

  • created php remote debug configuration in phpstorm

  • installed debugger tool addon for browser (chrome)

  • ran a container with docker-compose up -d

Xdebug is not working in both mac and windows
Please help.

@lamouf lamouf changed the title Docker is not working on both mac and windows xdebug is not working on both mac and windows Apr 7, 2020
@paulredmond
Copy link
Member

Hi, in order to help you can you share a public GitHub repo with your code?

@lamouf
Copy link
Author

lamouf commented May 10, 2020

Hi, Thanks for you response.
you will find the repo at : https://github.com/lamouf/laravel-xdebug.git

i added few images that can be helpful into readme.md.
Thanks

@paulredmond
Copy link
Member

@lamouf looks like it might be the quotes around the IP address:

# Your repo, docker-compose env will include the double quotes as part of the value.
PHP_XDEBUG_REMOTE_HOST="192.168.0.104"

# The correct configuration should be:
PHP_XDEBUG_REMOTE_HOST=192.168.0.104

You might also want to try this on Mac/Windows too:

PHP_XDEBUG_REMOTE_HOST=host.docker.internal

I am on a Mac, but looking at the Windows documentation, the host.docker.internal should work.

@paulredmond
Copy link
Member

Verified your repo works for me after adjusting that env value:

image

@paulredmond
Copy link
Member

Here's a visual of debugging the remote host env value included quotes (") inside the app container:

image

Then after I adjusted them to work for me, here's the value without quotes as PHP INI would expect it:

image

@paulredmond
Copy link
Member

I would also recommend setting PHP_XDEBUG_REMOTE_AUTOSTART=0 when you have schedulers and queues running, and use a browser extension to only start xdebug on the web application.

@lamouf
Copy link
Author

lamouf commented May 18, 2020

Great job Paul,
Thanks a lot for your priceless help. i works like a charm !!
Cheers.

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

2 participants