XDebug 没有格式化错误

发布于 2024-12-10 06:34:12 字数 477 浏览 0 评论 0原文

我已在 Mac OSX / XAMPP 上安装了 XDebug,并在 phpinfo() 中正确显示。但错误的格式并不像 xdebug 过去那样(这些橙色框看起来非常清晰)。

某些值已正确设置(出现在 phpinfo() 中):

  • display_errors : On
  • html_errors : On
  • xdebug.auto_trace : On

如果我将 xdebug.show_exception_trace 切换为 On 我会看到 XDebug 添加的新信息格式正确...这只是基本信息错误显示其外观未更改。然后我假设 XDebug 已正确启动并运行。

编辑1:这是我的 phpinfo 的 XDebug 部分 在此处输入图像描述

编辑 2:我有一个全新且干净的安装,不再出现此问题。

I have installed XDebug on Mac OSX / XAMPP and appears correctly in phpinfo(). But the errors aren't format in the way xdebug used to do (these orange box looked pretty clear).

Some values are correctly set (appearing in phpinfo()):

  • display_errors : On
  • html_errors : On
  • xdebug.auto_trace : On

If I switch xdebug.show_exception_trace to On I see the new informations added by XDebug correctly formated... This is just the basic errors display whose look as not changed. Then I assume that XDebug is correctly started and runnung.

EDIT 1 : Here's the XDebug section of my phpinfo
enter image description here

EDIT 2 : I've a new fresh and clean installation where this problem doesn't occure anymore.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

止于盛夏 2024-12-17 06:34:12

这使它对我有用:如何启用格式化的 Xdebug 错误和跟踪< /a>

基本上,只需在 php.ini 中设置 html_errors = On 即可。

This made it work for me: How to enable formatted Xdebug errors and traces

Basically, just set html_errors = On in php.ini.

記憶穿過時間隧道 2024-12-17 06:34:12

xdebug.default_enable 负责改进正常错误显示 - 它在您的情况下被激活,所以它应该可以工作。

要测试它是否真的有效,请创建一个新的 php 脚本

trigger_error('foo');

并查看是否有效。如果是这样,那么您的应用程序可能会更改设置。


顺便说一句,auto_trace 并没有改变这个问题。

The xdebug.default_enable is responsible for improving normal error display - and it is activated in your case, so it should work.

To test if it really works, create a fresh php script with

trigger_error('foo');

and see if that works. If it does, then probably your application changes the setting.


Btw, auto_trace does not change a thing for this problem.

美煞众生 2024-12-17 06:34:12

我注意到你说

错误的格式与 xdebug 过去的格式不同

,内容未格式化

我遇到了格式问题:我页面的 css 破坏了 xdebug 显示!
结果,大量的白底白字产生了奇怪的格式。

我在 [firefox profile]/chrome/userContent.css 中添加了一些规则,

.xdebug-error {
  color: black;
  font-size: 14px;
}
.xdebug-error tr:first-child th {
  padding: 20px !important;
}
.xdebug-error tr:first-child th span {
  background: transparent !important;
  color: red !important;
  display: block !important;
  float: left !important;
  font-size: 50px !important;
  padding-right: 20px !important;
}
.xdebug-error tr:first-child th a {
  color: #fff !important;
}
.xdebug-error a {
  text-decoration: none;
}
.xdebug-error a:hover {
  text-decoration: underline;
}
.xdebug-error td {
  padding: 5px;
}

其中大部分都有效;不知道为什么 :first-child 标签失败 <耸肩>

祝你好运!蒂姆

I notice you say

errors aren't format in the way xdebug used to

not that the content is unformatted..

I had a formatting issue: my page's css was nuking the xdebug display!
as a result, lots of white on white producing bizarre formatting.

I added some rules to [firefox profile]/chrome/userContent.css

.xdebug-error {
  color: black;
  font-size: 14px;
}
.xdebug-error tr:first-child th {
  padding: 20px !important;
}
.xdebug-error tr:first-child th span {
  background: transparent !important;
  color: red !important;
  display: block !important;
  float: left !important;
  font-size: 50px !important;
  padding-right: 20px !important;
}
.xdebug-error tr:first-child th a {
  color: #fff !important;
}
.xdebug-error a {
  text-decoration: none;
}
.xdebug-error a:hover {
  text-decoration: underline;
}
.xdebug-error td {
  padding: 5px;
}

most of which works; not sure why the :first-child tags fail < shrug >

good luck! Tim

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文