PHPStorm无法与xdebug建立外部连接

时间:2013-01-30 04:50:57

标签: ide xdebug phpstorm

我的操作系统是Mac Mountain lion。

我的PhpStorm版本是5.0.4。

这是我的php xdebug信息:

  • xdebug.remote_autostart => Off =>关
  • xdebug.remote_connect_back => Off =>关
  • xdebug.remote_cookie_expire_time => 3600 => 3600
  • xdebug.remote_enable => On =>上
  • xdebug.remote_handler => dbgp => dbgp
  • xdebug.remote_host => 127.0.0.1 => 127.0.0.1
  • xdebug.remote_log => data / logs / xdebug.log =>数据/日志/ xdebug.log
  • xdebug.remote_mode => req => REQ
  • xdebug.remote_port => 9000 => 9000
  • xdebug.idekey =>没有价值=>没有价值

我可以在PhpStorm中调试PhpScript Run Type,它运行正常。所以我觉得xdebug配置得很好。

但是在我尝试按照“零配置调试”(使用Web应用程序运行类型)后,Phpstorm无法连接传入连接。

这是我的步骤:

  1. 单击开始Listion Php Connection。(将呼叫切换为绿色)
  2. 点击运行 - >在PhpScript的第一行中断,并在第一个语句处设置断点。
  3. 选择My WebApplication Config并单击Debug按钮。然后启动chrome并链接到我的phpscript。(使用?XDEBUG_SESSION_START = 19869)
  4. 在PhpStorm中,调试器显示等待与ide键'19869'的传入连接。
  5. 在终结时,打印lsof -i4TCP:9000
      

    命令PID用户FD类型设备大小/关闭节点名称
      webide 288 wangfeng 69u IPv6 0xa83881cdce30c579 0t0 TCP *:cslistener(LISTEN)

  6.   
  7. 打开Chrome的开发者工具,选择Cookie。

      

    XDEBUG_SESSION 19869 localhost / Wed,2013年1月30日05:27:17 GMT 19

  8. 刷新Chrome.Not无法连接PhpStorm调试连接。
  9. 其他:

    • 我的防火墙已关闭。
    • 我的服务器是nginx.My phpwebapp和服务器都在我的本地机器上。

    是否会导致ipv6?

    希望有所帮助!我已经尝试了所有内容,扩展了bookmarklet,根本无法使用。

2 个答案:

答案 0 :(得分:14)

其他进程可能正在使用端口9000。

  1. 在php.ini中设置xdebug.remote_port=9001或您选择的其他未使用的端口。
  2. 在PHPStorm中,转到Settings-> PHP-> Debug并在Xdebug部分下将Debug port设置为9001.
  3. 重新启动您的网络服务器。
  4. 开始调试。

答案 1 :(得分:1)

在检查php.ini文件和IDE中的所有配置之后,不要忘记添加基本上通过IDE通过IDE进行通信的特定于浏览器的扩展。

请参阅此link