使用端口转发在{VM}中配置XDebug

时间:2016-01-13 15:58:56

标签: php xdebug

我有一个Vagrant VirtualBox VM通过NAT端口转发连接到我的桌面(由于VPN和数据库访问规则,无法桥接VM),我正在尝试在PHP实例中设置XDebug。

使用本地WAMP设置时相当简单的任务,但在NAT的上下文中却没有那么多。我试图在端口9000上打开VirtualBox中的端口转发规则,该规则不做任何更改(NetBeans声称它正在等待连接)。我尝试过使用PuTTY来隧道另一个端口,结果相同。

我不确定我还应该尝试做些什么。我正在查看xdebug.remote_connect_back作为选项,但似乎我的IDE甚至没有尝试建立连接。关于在哪里寻找下一步的想法?

这是我的XDebug设置(在CentOS 7上运行,带有PHP 5.4.16)

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"

VirtualBox有三个转发端口:8889到VM 80(用于httpd),2497到22(用于ssh),9000用于9000(用于XDebug)。 PuTTY将端口9690隧道传输到9000。

0 个答案:

没有答案