简体   繁体   English

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

[英]xdebug Time-out connecting to client. :-( using phpstorm 7.1.3/vagrant/virtualbox/magento

For a while, I was using Phpstorm EAP, and had xdebug running perfectly. 有一段时间,我正在使用Phpstorm EAP,并且xdebug完美运行。 I recently purchased a personal license and imported all my settings from the EAP into 7.1.3. 我最近购买了个人许可证,并将我在EAP中的所有设置导入7.1.3。 Now xdebug does not work. 现在xdebug不起作用。

Here's xdebug.ini 这是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. xdebug也在php.ini中显示。 I even ran it in http://xdebug.org/wizard.php and the latest version is installed. 我甚至在http://xdebug.org/wizard.php中运行它并安装了最新版本。

Phpstorm is listening on port 9000 for xdebug, and "Listen for PHP Debug Connections" is on. Phpstorm正在侦听端口9000上的xdebug,并且“侦听PHP调试连接”已启用。

My xdebug log constantly tells me this: 我的xdebug日志经常告诉我这个:

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/ 我甚至尝试过注册表编辑: http//brianreiter.org/2010/09/18/fix-virtualbox-host-only-network-adapter-creates-a-virtual-public-network-connection-that-c​​auses -Windows到禁用服务/

No matter what I try, xdebug times out. 无论我尝试什么,xdebug都会超时。 Even with all firewalls off. 即使关闭了所有防火墙。

I'm on Windows 7 Enterprise. 我在Windows 7 Enterprise上。 VM is puphpet/centos65-x64 VM是puphpet / centos65-x64

EDIT Forgot to mention the IDE key in Phpstorm is PHPSTORM 编辑忘了在Phpstorm中提到IDE密钥是PHPSTORM

To answer your confusion directly, two settings stand out. 为了直接回答您的困惑,两个设置脱颖而出。 They are xdebug.remote_host and xdebug.remote_connect_back . 它们是xdebug.remote_hostxdebug.remote_connect_back The former setting's IP is incorrect, especially in a Vagrant setup. 前一个设置的IP不正确,尤其是在Vagrant设置中。 It should be something like 10.0.2.2 . 它应该像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. 但是,这些设置只是Xdebug无法工作的部分原因。

Extended: setup Xdebug in PhpStorm with Vagrant 扩展:使用Vagrant在PhpStorm中设置Xdebug

Vagrant introduces a layer of complexity not present in a standard, non-virtualized development environment. Vagrant引入了标准的非虚拟化开发环境中不存在的复杂层。 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. 虽然上述几点可能是正确的,但是为了通过Vagrant在PhpStorm中运行Xdebug,还需要遵循其他设置和过程。 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. 我也使用CentOS 6.5 64位,指南反映了这一点。 It has even been tested against Magento. 它甚至已经针对Magento进行了测试。

How to configure Xdebug in PhpStorm through Vagrant 如何通过Vagrant在PhpStorm中配置Xdebug

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM