Enable Xdebug HTML Output

I recently updated to Ubuntu 10.04 which includes PHP-5.3 by default. Ever since that upgrade I’ve had trouble with Xdebug not displaying HTML in its output: instead it would output human-readable text which becomes quite unreadable when rendered in the browser without <pre> tags.

Turns out when PHP was upgraded, the php.ini file was replaced, and in the new version, it has the production value for html_errors which is Off. Once I set html_errors=On in /etc/php5/apache, colourful HTML-formatted output was producted by Xdebug.

For the Curious reader, I’m using the following xdebug configuration file, which I’ve located in /etc/php5/conf.d/xdebug.ini to prevent any php.ini changes from overwriting my Xdebug directives. Please note that this is a slightly modified version of the default xdebug configuration included in wamp, which I find to be quite nice:

  1. #1 by Greg on May 31, 2010 - 6:31 pm

    Thanks for the tip, worked for me.

  2. #2 by Robin Corps on March 29, 2011 - 2:18 pm

    Thanks for this, just had the same issue when upgrading to Ubuntu 10. I forgot about the html_errors setting all together.

  3. #3 by Andy on October 27, 2011 - 7:22 am

    Was stuck deep in xdebug docs, thanks for the tip!

(will not be published)