无法使用PhpStorm + Vagrant + XDebug进行调试
问题描述:
我无法让XDebug在Windows 7计算机上与PhpStorm和Vagrant一起使用.我已经按照每个教程进行了操作,但是没有运气.
I cannot get XDebug to work with PhpStorm and Vagrant on a Windows 7 machine. I've already followed every tutorial on getting this to work but with no luck.
所以我尝试的是:
- PhpStorm始终侦听调试连接
- xdebug.ini文件,其中包含以下内容:
zend_extension = "..../xdebug.so"
xdebug.remote_enable= 1
xdebug.remote_handler=dbgp
xdebug.remote_host= 33.33.33.10
xdebug.remote_port= 9000
xdebug.remote_connect_back= 1
xdebug.remote_autostart= 1
xdebug.remote_log = "...."
- 设置PhpStorm以连接到
localhost:8080
以及33.33.33.10
,都没有运气. - 日志文件始终输出:
- Setup PhpStorm to connect to
localhost:8080
and too33.33.33.10
, both with no luck. - The log file always outputs:
I: Checking remote connect back address.
W: Remote address not found, connecting to configured address/port: 33.33.33.10:9000. :-|
E: Could not connect to client. :-(
- 当我尝试调试时,防火墙(ESET Smart Security)始终关闭
- 设置路径映射也不起作用
我只是不知道该怎么办,但我确实需要能够进行调试.
感谢您的帮助!
I just don't know what to do, but I really NEED to be able to debug.
Thanks for your help!
答
问题非常愚蠢-我在Vagrantfile中转发了端口9000,而不必这样做...
The problem was very stupid - I forwarded port 9000 in the Vagrantfile, and I didn't have to do so...
现在,实际上我看到xdebug.ini中唯一需要的行是:
Now, actually I see that the only necessary lines in xdebug.ini are:
zend_extension = ...
xdebug.remote_enable = on
xdebug.remote_connect_back = on
如果您不做愚蠢的事情,则设置非常简单...
The setup is pretty straightforward, if you don't do stupid things...