Ubuntu Server packages are generally pretty well-configured right out of the box–usually requiring little or no configuration for simple operation. It’s one of the reasons why, despite my preference toward Arch Linux for the desktop, I’ve long advocated Ubuntu as a great starting point for a LAMP development server. Yet, on occasion, a package ships with a configuration that needs some work in order to be useful. Xdebug is such a package.
Xdebug’s most immediately helpful feature is the display of stack traces for all PHP errors. (Actually, it does a whole lot more than that, but that’s beyond the scope of this post.) Stack traces appear in place of the ordinary PHP error notices, so they require that the PHP config option display_errors is enabled. But Ubuntu disables this option by default.
This is actually a sane default, because error notices may potentially expose security holes or other sensitive data, and thus should be suppressed in production environments. But installing Xdebug implies that the target is a development and/or testing environment (for a lot of reasons, not the least of which is Xdebug’s non-trivial processing overhead). So it makes sense that display_errors should be enabled.
This is a simple fix. Edit /etc/php5/apache2/php.ini, locate the display_errors option, and change its value from Off to On. The final result should look like this:
display_errors = On
Alternatively, you can add that line to the end of the Xdebug config file located in /etc/php5/conf.d/. This allows you to enable/disable the display of errors at the same time as you enable/disable the Xdebug module. (This can be done by invoking either of the provided scripts php5enmod and php5dismod and reloading Apache.)
I have filed a bug report to notify the devs about this issue. I hope this post and an eventual bug fix will save other folks some frustration.