局域网上的Docker / Xdebug多个开发人员 [英] Docker / Xdebug Over LAN Server Multiple Developers

查看:106
本文介绍了局域网上的Docker / Xdebug多个开发人员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在办公室的某些容器上设置Xdebug。我们有一台运行Docker的Ubuntu服务器,防火墙通过LAN全面开放。

I'm attempting to setup Xdebug on some containers we have at the office. We have a Ubuntu server running Docker with the firewall wide open over LAN.

理想情况下,每个开发人员都想使用PhpStorm(我们在已安装的samba驱动器上工作)来调试各个网站上的代码。

Ideally each developer would like to use PhpStorm (which we work over a mounted samba drive), to debug code on various websites.

我们使用Apache,并使用jwilder nginx代理服务器在docker中服务多个站点。

We use Apache and have the jwilder nginx proxy to server multiple sites in docker.

我尝试设置一个没有运气的DBGp代理,因此远。 php.ini看起来像这样:

I've attempted to setup a DBGp proxy with no luck so far. php.ini looks like this:

xdebug.remote_enable=1
xdebug.remote_host=containername
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_mode=req

在DBGp代理的容器内,我将其与Apache放在同一网络上,并在外部绑定9001,例如- 9012:9001

Inside the container for the DBGp proxy I have it on the same network as Apache and bind the 9001 externally e.g. - "9012:9001"

使用IDE似乎确实可以在PhpStorm中检测到DBGp代理。我侦听连接并将IDE密钥放在get变量中以启动Xdebug会话。我也尝试过Zend Debugger扩展。此时,没有命中任何断点,脚本继续。

Using the IDE It does appear to detect the DBGp proxy correctly in PhpStorm. I listen for connections and place the IDE key in the get variable to start Xdebug session. I've tried with the Zend Debugger extension as well. At this point no break points are hit and the script just continues.

我是否需要在PhpStorm中执行任何操作来告诉PhpStorm文件目录与服务器上的目录不匹配?我是否在php.ini文件中丢失了某些内容。

Do I need to do anything in PhpStorm to tell PhpStorm that the file directory doesn't match the directory on the server? Am I missing something in the php.ini file.

在这种情况下,我可以简单地使用远程连接返回多个开发人员并摆脱DBGg吗?如果该端口通过docker主机上的UFW阻止到外部世界(我假设至少每个人都说这些开发站点会暴露在世界上,至少每个人都可以触发Xdebug),将会带来安全风险吗?

In this scenario could I simply use remote connect back for multiple developers and get rid of DBGg? Would it pose a security risk if the port was blocked via UFW on the docker host to the external world (I presume at the very least everyone could trigger Xdebug as these development sites are exposed to the world per say)?

推荐答案

很难说出问题所在以及如何解决。您是否尝试在第一行代码处中断(运行->在第一行处中断)?如果这不能停止,则您的调试连接未建立。还可以尝试 xdebug.remote_connect_back 而不是定义远程主机

hard to tell what's wrong and how to solve it at this point. did you try to break at the first line of code (run->break at first line)? if this does not stop your debug connection is not established. also try xdebug.remote_connect_back instead of defining the remote host

这篇关于局域网上的Docker / Xdebug多个开发人员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆