我在虚拟机(Ubuntu guest )上使用 Xdebug。 我正在使用 Vagrant管理这些 VM,我正在配置一个“模式”操作系统来克隆它以进行 Web 开发。 问题是我想配置这个 ubuntu guest 来接受来自任何主机的 xdebug 连接(xdebug 显然在 guest 操作系统中)。
这些指令不起作用:
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_connect_back=1
xdebug.remote_port=9000
唯一的方法似乎是添加一行:
xdebug.remote_host=sdurzu
“sdurzu”是主机的主机名,但我想为 xdebug 创建一个“通用”配置,而不是基于主机名或 IP。
有没有办法使用通配符 (*) 或类似的东西?
最佳答案
根据Xdebug settings documentation ,如果启用了 remote_connect_back
,则忽略 remote_host
。
xdebug.remote_connect_back
Type: boolean, Default value: 0, Introduced in Xdebug >= 2.1If enabled, the xdebug.remote_host setting is ignored and Xdebug will try to connect to the client that made the HTTP request. It checks the $_SERVER['HTTP_X_FORWARDED_FOR'] and $_SERVER['REMOTE_ADDR'] variables to find out which IP address to use.
[...]
此外,remote_connect_back
应该允许任何设备连接到有权访问您的网络服务器的 Xdebug。
关于php - Xdebug:来自任何主机的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14690891/