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 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算