Yii Outputs Complete Trash When Exception Is Thrown

Hi,

TL;DR - it seems Yii’s exception handler outputs nonsense trash under some circumstances (depending on environment most likely) - see picture below

so, during the deployment today I’ve stumbled upon this very strange problem. It seems that the Yii’s exception handler produces complete trash on output, on the production server only. The output is some raw byte data, not enclosed in html, and looks like this:

http://i.imgur.com/ogNjIQw.png

I’ve been playing with index.php for a while, and there’s what I’ve found out:

  1. throwing any "plain" exception before Yii::createWebApplication is called, causes normal PHP message saying there was unhandled exception

  2. if I surround the Yii::createWebApplication with try-catch block and do var_dump($e) in the catch block, it behaves as expected (dumps the exception object which contains all the necessary info - message, call stack etc)

  3. removing errorAction setting from config file doesnt change the way it behaves

  4. when YII_DEBUG is unset, the "trash output" is much shorter - so it seems it is not that random as it looks to be.

any tips? I’ve did quite a few Yii deployments so far, but have never seen anything like this