douxue4395 2014-07-18 18:39
浏览 149
已采纳

xdebug连接到客户端的超时。 :-(使用phpstorm 7.1.3 / vagrant / virtualbox / magento

For a while, I was using Phpstorm EAP, and had xdebug running perfectly. I recently purchased a personal license and imported all my settings from the EAP into 7.1.3. Now xdebug does not work.

Here's xdebug.ini

zend_extension=xdebug.so

xdebug.remote_host = 192.168.56.1
xdebug.remote_cookie_expire_time = 36000
xdebug.remote_log = /tmp/xdebug.log
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.idekey="PHPSTORM"
xdebug.scream=0
xdebug.remote_connect_back=1
xdebug.show_local_vars=1

xdebug is also showing in the php.ini. I even ran it in http://xdebug.org/wizard.php and the latest version is installed.

Phpstorm is listening on port 9000 for xdebug, and "Listen for PHP Debug Connections" is on.

My xdebug log constantly tells me this:

Log opened at 2014-07-18 17:46:16
I: Checking remote connect back address.
I: Remote address found, connecting to 192.168.56.1:9000.
E: Time-out connecting to client. :-(
Log closed at 2014-07-18 17:46:16

I've even tried a registry edit: http://brianreiter.org/2010/09/18/fix-virtualbox-host-only-network-adapter-creates-a-virtual-public-network-connection-that-causes-windows-to-disable-services/

No matter what I try, xdebug times out. Even with all firewalls off.

I'm on Windows 7 Enterprise. VM is puphpet/centos65-x64

EDIT Forgot to mention the IDE key in Phpstorm is PHPSTORM

  • 写回答

1条回答 默认 最新

  • duanhuiqing9528 2014-08-08 15:53
    关注

    To answer your confusion directly, two settings stand out. They are xdebug.remote_host and xdebug.remote_connect_back. The former setting's IP is incorrect, especially in a Vagrant setup. It should be something like 10.0.2.2. Furthermore, the latter setting should not be defined and enabled. When it is enabled, it completely ignores the former setting, thus rendering it useless. To summarize, the former setting is wrong, and the latter setting ignores it, but that latter setting is also wrong. These settings are only part of the reason Xdebug will not work, though.

    Extended: setup Xdebug in PhpStorm with Vagrant

    Vagrant introduces a layer of complexity not present in a standard, non-virtualized development environment. While the points above are probably correct, there are still additional settings and procedures that need to be followed in order to run Xdebug in PhpStorm through Vagrant. I struggled with this for a while, and after several failed attempts, succeeded in getting a connection. There is also a big deficit in documentation available online to achieve this kind of setup, so after successfully getting the whole setup working, I documented the guidelines on my blog. The entire setup process is described in detail, peppered with relevant screenshots. I also use CentOS 6.5 64bit, and the guidelines reflect that. It has even been tested against Magento.

    How to configure Xdebug in PhpStorm through Vagrant

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler