【问题标题】:How does the new Xdebug 3 configuration work?新的 Xdebug 3 配置如何工作?
【发布时间】:2021-03-23 02:45:39
【问题描述】:

在 Xdebug 2 中,我正在使用这个配置:

; Do not show Xdebug "enhanced" error messages:
xdebug.default_enable = 0

; Start debugging when XDEBUG_SESSION cookie comes in:
xdebug.remote_enable=1

; Start a profile when XDEBUG_PROFILE cookie comes in:
xdebug.profiler_enable_trigger = 1

这如何转化为新的 Xdebug 3 配置格式?

我试过了

xdebug.mode = debug,profile
xdebug.start_with_request=trigger

但它会在需要分析时开始调试。 (这可能是一个错误?)

编辑澄清:当然我不想同时调试和配置,只需使用 Xdebug 助手在它们之间切换:

【问题讨论】:

  • xdebug.mode = debug,profile -- 这对我来说毫无意义。我的意思是:分析通常意味着测量执行速度......而调试会产生延迟(在断点处停止,将上下文值获取到您的 IDE 等),因此会为分析提供不正确的值。从这个意义上说,它们并不是那么兼容。文档说xdebug.start_with_request=trigger 将适用于选择的任何模式.. 但你已经列出了其中的 2 个......你可以尝试交换订单 (profile,debug) 但我认为这不会有任何区别TBH。
  • @LazyOne 当然我不会同时进行分析和调试(Xdebug 助手甚至不允许这样做),但我认为它们必须在 php.ini 中启用才能能够在运行时同时使用这两个函数?
  • 您可以在需要时在它们之间切换(通过编辑该值)——这就是我的理解。来自 Xdebug 的作者自己的博客文章 2 年前 derickrethans.nl/xdebug-experience.html -- “以及一些不应该一起使用(xdebug.remote_enable 和 xdebug.profiler_enable)。” P.S.我看到你已经报告过——bugs.xdebug.org/view.php?id=1915——会检查一下,看看 Derick 会说什么。
  • @LazyOne profiler_enable_trigger != profiler_enable
  • 我知道,因为我一直以同样的方式使用它???? (最后一次是大约 1 年前)。我已经提到过,以表明该领域存在普遍问题,并且可能可能是故意以这种方式实现的(以便您必须选择2之间...)

标签: php xdebug ini


【解决方案1】:
xdebug.mode = debug,profile
xdebug.start_with_request=trigger

对我来说很好,它只启动 Xdebug 助手请求的操作,而不启动另一个。

【讨论】:

猜你喜欢
  • 2021-04-13
  • 2021-05-04
  • 2021-04-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-15
  • 1970-01-01
  • 2014-08-10
相关资源
最近更新 更多