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:
I’ve been playing with index.php for a while, and there’s what I’ve found out:
throwing any "plain" exception before Yii::createWebApplication is called, causes normal PHP message saying there was unhandled exception
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)
removing errorAction setting from config file doesnt change the way it behaves
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