dongpochi9741 2019-06-21 23:23 采纳率: 100%
浏览 112
已采纳

Xdebug Docker跨集装箱通信设置

I'm having an issue with multiple container / cross container Xdebug PhpStorm communication.

I have a setup with 10 containers who talk to one another but can't seem to get Xdebug working across all of them.

As an example: Container A makes a request to Container B which makes a request to Container C. How do I get breakpoints to stop at Container B and C ?

At the moment I get a timeout, without Xdebug they communicate without a problem.

As a side note Cross container communication is working they are in the same network and Xdebug works independently fine on each container.

This is the Xdebug config in all of my containers:

xdebug.remote_port=9006
xdebug.remote_autostart=1
xdebug.remote_enable=1  
xdebug.remote_connect_back=0 
xdebug.remote_host=10.254.254.254 
xdebug.idekey=PHPSTORM
  • 写回答

1条回答 默认 最新

  • duandazhen7306 2019-06-22 00:01
    关注

    Found the solution,

    after a bit further digging in kind of related github issues I found this thread: https://github.com/docksal/docksal/issues/389 and this stackoverflow question: Docker / Xdebug Over LAN Server Multiple Developers

    Which led me to try this working configuration:

    The final config in all of the containers is now:

    xdebug.remote_port=9006
    xdebug.remote_autostart=1
    xdebug.remote_enable=1  
    xdebug.remote_connect_back=0 
    xdebug.remote_host=10.254.254.254 
    xdebug.idekey=PHPSTORM
    

    Basically using dockers internal network and using remote connect back solved it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制