XDebug没有格式化错误

时间:2011-10-15 21:14:49

标签: php macos xampp xdebug

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

正确设置了一些值(出现在phpinfo()中):

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

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

编辑1:这是我的phpinfo的XDebug部分 enter image description here

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

3 个答案:

答案 0 :(得分:6)

这使它对我有用:How to enable formatted Xdebug errors and traces

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

答案 1 :(得分:4)

xdebug.default_enable负责改善正常错误显示 - 并且在您的情况下会激活它,因此它应该可以正常工作。

要测试它是否真的有效,请使用

创建一个新的php脚本
trigger_error('foo');

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


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

答案 2 :(得分:2)

我注意到你说

  

错误不是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标签失败<耸肩>

祝你好运!添