xdebug 连接到客户端超时.:-( 使用 phpstorm 7.1.3/vag

xdebug Time-out connecting to client. :-( using phpstorm 7.1.3/vagrant/virtualbox/magento(xdebug 连接到客户端超时.:-( 使用 phpstorm 7.1.3/vagrant/virtualbox/magento)
本文介绍了xdebug 连接到客户端超时.:-( 使用 phpstorm 7.1.3/vagrant/virtualbox/magento的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一段时间,我使用 Phpstorm EAP,并且 xdebug 运行良好.我最近购买了个人许可证并将我的所有设置从 EAP 导入到 7.1.3.现在 xdebug 不起作用了.

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.

这里是 xdebug.ini

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 也显示在 php.ini 中.我什至在 http://xdebug.org/wizard.php 中运行它并安装了最新版本.

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 正在端口 9000 上侦听 xdebug,并且侦听 PHP 调试连接"已开启.

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

我的 xdebug 日志不断告诉我:

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

我什至尝试过注册表http://brianreiter.org/2010/09/18/fix-virtualbox-host-only-network-adapter-create-a-virtual-public-network-connection-that-c​​auses-windows-to-disable-services/

无论我尝试什么,xdebug 都会超时.即使关闭了所有防火墙.

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

我使用的是 Windows 7 Enterprise.虚拟机是 puphpet/centos65-x64

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

编辑忘了说Phpstorm中IDE的key是PHPSTORM

EDIT Forgot to mention the IDE key in Phpstorm is PHPSTORM

推荐答案

为了直接回答您的困惑,有两个设置很突出.它们是 xdebug.remote_hostxdebug.remote_connect_back.前一个设置的 IP 不正确,尤其是在 Vagrant 设置中.它应该类似于 10.0.2.2.此外,不应定义和启用后一种设置.启用后,它会完全忽略之前的设置,从而使其变得无用.总结一下,前一个设置是错误的,后一个设置忽略它,但是后一个设置也是错误的.不过,这些设置只是 Xdebug 无法工作的部分原因.

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.

Vagrant 引入了一层在标准的非虚拟化开发环境中不存在的复杂性.虽然以上几点可能是正确的,但为了通过 Vagrant 在 PhpStorm 中运行 Xdebug,仍然需要遵循额外的设置和过程.我为此苦苦挣扎了一段时间,在多次尝试失败后,成功建立了连接.实现这种设置的在线文档也有很大的不足,所以在成功使整个设置工作后,我在我的博客上记录了指导方针.详细描述了整个设置过程,并附有相关屏幕截图.我也使用 CentOS 6.5 64 位,指南反映了这一点.它甚至已经针对 Magento 进行了测试.

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.

如何通过Vagrant在PhpStorm中配置Xdebug

这篇关于xdebug 连接到客户端超时.:-( 使用 phpstorm 7.1.3/vagrant/virtualbox/magento的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)