xdebug running in PHPStorm unable to connect to remote server

拈花ヽ惹草 提交于 2019-12-11 10:54:32

问题


Problem

I'm trying to get xdebug running between my box and a webapp running on a remote server.

I'm running xdebug through PHPStorm on my development box. I get stuck after starting the debugger. The PHPStorm debugger window hangs on "Waiting for incoming connection with ide key 'PHPStorm'"

Remote Server Configs

On the remote server, our sys admin has installed xdebug. The server has the following settings:

xdebug.remote_port  9000
xdebug.default_enable   On  
xdebug.remote_enable    On
xdebug.remote_connect_back  On

Note that remote_connect_back is on. I'm configuring this for a multi-developer environment. This will cause xdebug.remote_host to be ignored (which is why I didn't include it up there).

I'm using the Firefox "The Easiest xdebug" addon. If I refresh a page with the xdebug addon disabled, the page loads just fine.

If I enable the addon for that page and refresh, the page will hang until timeout. I believe this tells me that xdebug is running and at least TRYING to do something. Right? So far so good.

Client Configs

I'm running PHPStorm on my local dev box. I have also installed xdebug on my dev box. Here's some relevant output from php -i:

xdebug support => enabled
xdebug.default_enable => On => On
xdebug.idekey => PHPStorm => PHPStorm
xdebug.remote_enable => On => On
xdebug.remote_port => 9000 => 9000
xdebug.remote_host => localhost => localhost
xdebug.remote_connect_back => Off

I'm using xdebug version 2.2.3 on the server and 2.2.7 on the client. I need to use old versions, because we're stuck on PHP 5.3... at least for now. Both client and server are running PHP 5.3.

In PHPStorm, I set up a server config connecting to the remote server:

devops-dev.ourcloud.com

I have a path mapping to an absolute path on the server: var/www/api/apidev.ourcloud.com/current

Waiting on port 9000. I have my IDEKey in PHPStorm set to "PHPStorm".

Results

I click the phone to listen for debugger connections and click the green debugger icon, and in the debugger view, I see:

Waiting for incoming connection with ide key 'PHPStorm'

And that's it. I don't seem to be connecting to the server.

Any clue what's causing this or even how I might be able to better debug this?


回答1:


Looks like it was a firewall problem. I was able to fix the problem by running an ssh tunnel from my client to my server:

ssh -f -N -T -R9000:localhost:9000 theserver

I was also able to find this issue using netcat from the server to the client.

From server: nc client 9000

That showed that the port was blocked.



来源:https://stackoverflow.com/questions/31039055/xdebug-running-in-phpstorm-unable-to-connect-to-remote-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!