dongquming3255 2015-06-24 23:52
浏览 394

在PHPStorm中运行的xdebug无法连接到远程服务器

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条回答 默认 最新

  • duanlian1960 2015-06-30 18:37
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)