Vagrant + Parallels, can't get XDebug to work on PHPStorm

I recently installed Vagrant + Parallels and I'm trying to get the debug on PHPStorm to work with no success. I followed the installation procedure, Vagrant is up and running, PHPStorm is listening for calls, but it seems like the calls never get there :/ Has anyone had a similar issue? 

Comment actions Permalink

I should add that the debugger on PHPStorm displays the "Waiting for incoming connection with ide key 'VVVDEBUG'" message, but never seems to receive any connections...

Comment actions Permalink

Hi there,

1) Post your live Xdebug config: xdebug_info(); for Xdebug v3 or whole Xdebug section from phpinfo() output if Xdebug v2 is used.

2) Also show your PhpStorm debug settings: Xdebug and "PHP | Server" entry settings.

3) Enable Xdebug log, try to debug and share that log: it will show if Xdebug is trying to connect at all and if it does -- where and what the result is.

Xdebug 3: Diagnostics - YouTube

Comment actions Permalink

Here's the info, I've got. I'm running Vagrant on Parallels and running PHPStorm on the Mac. I'm new to all this, and can't seem to find a lot of resources on running this setup on MacOS, so any help is aprecciated. PHPStorm seems to be listening to the connections, but for some reasons they never seem to get there...

Comment actions Permalink



Right now it looks like the client IP is wrong or host:ip is inaccessible (no service is listening there or a firewall is in action).

1) What is __gateway? Which IP it resolves to? Make sure it gets resolved to IPv4 (as IPv6 may have issues)

xdebug.client_host should point to the machine where debug client (PhpStorm in this case) is running. Unless, of course, if you are using DBGpProxy or reverse SSH tunnel. If __gateway points to a host OS machine (where your virtualisation software and the IDE is running) then it should be correct.

You can try an exact IPv4 address there instead.

You can also try enabling xdebug.discover_client_host so Xdebug tries the IP from the request headers.

What $_SERVER['REMOTE_ADDR'] in PHP shows for such a request? Is it different from what __gateway gets resolved to?

2) You are on Mac. Can you please double check that it's PhpStorm that listens on Xdebug TCP 9003 port? You can hit the phone handle icon so it becomes green (or hit the Debug button like you do so that the Debug panel becomes visible) and then check in terminal with sudo lsof -nP -iTCP -sTCP:LISTEN or alike command. The IDE can detect that port is already in use on Linux and Windows but not on Mac (for whatever reason)...

3) If you can SSH into your server there, try connect back to the IDE with telnet. You can also try simple command line client -- just to see if that will work:

If telnet cannot connect then well .. must be a firewall, wrong ip:port combination or nobody listens on that port.

P.S. All these are general troubleshooting info: I'm not Mac user myself.

Comment actions Permalink

Andriy Bazanov setting Xdebug.discover_client_host to 1 fixed the issue :) Thank you so much for your help


Please sign in to leave a comment.