Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XDebug is not formatting error

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.

like image 724
AsTeR Avatar asked Oct 15 '11 21:10

AsTeR


3 Answers

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

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

like image 134
frnhr Avatar answered Oct 23 '22 10:10

frnhr


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.

like image 4
cweiske Avatar answered Oct 23 '22 10:10

cweiske


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

like image 2
ptim Avatar answered Oct 23 '22 10:10

ptim