CDBException displaying PHP internals

Much like in this post,

Instead of routing to the site/error, it’s displaying the PHP code to the end user. Ideally, I’d like to, if my IP show the PHP code error so I can resolve/debug and when they encounter it, I can 404 them and send myself an email with the requested URL.

My local development machine doesn’t reproduce this issue! It goes to the site/error and shows 404. I thought it had to do with error_reporting() but unless it’s not for some reason accepting my settings, it’s still displaying. I’m not sure how to write a good google search for this scenario. Sorry if it’s something obvious, I’d hoped that someone could say definitively, that it is XYZ or error_reporting or an apache (.htaccess) setting or…

Thank you in advance for your time. This is a legacy 1.1.x project

Errors, exceptions not handled, stack traces and other scary stuff usually gets displayed when debug mode is enabled. When disabled, this is hidden from production. Are you sure you do not have debug mode mixed up between your dev and production environments?

Dude! it seems SO obvious when you said it I was like “Nah!” that’s silly… BUT in my debugging I’d added an always true condition

if (1) 


               // local debug yes, but not on a production

                defined('YII_DEBUG') or define('YII_DEBUG',true);

                defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

                $config = dirname(__FILE__).'/protected/config/test.php';

                error_reporting(E_ALL ^ E_NOTICE);

                ini_set("display_errors", 1);


SO stupid! But took me 5 seconds to find with your hint

THANK YOU. (I knew about that very well, but it just didn’t make sense that I’d do that)