[SOLVED] "Production Mode" always ON

It’s probably a stupid question, but my application is suddenly stuck on “Production Mode” and I’m too far in the commits to rollback.

I copied “defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, TRUE)” right over the Yii::createWebApplication and still the application is set to Prod <_<

defined('YII_DEBUG') or define('YII_DEBUG', TRUE); //Added right on top of run() still no effect.

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

if( !$hasError )

       Yii::createWebApplication( $config )->run();

[color="#4169E1"]Anyone knows where this could of been switched to prod?

Or where can I, at least, force it back to Debug mode?[/color]

What makes you think your app is in prod mode? Have you tried to add error_reporting(E_ALL); ?

Thank you for your awnser Bizley.

When I do:


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

echo "YII_DEBUG: ".CVarDumper::dumpAsString( YII_DEBUG, 10,true);

I get:

YII_DEBUG: false

The YII_DEBUG affectation don’t want to register for some reason ???

Make sure you haven’t got it defined twice. This part means that only the first definition will be used:

defined('YII_DEBUG') or ...

Thank you for your reply Keith

This is my full code, I have commented everything else! :


$yii =  dirname(__FILE__).'/protected/yii/framework/yii.php';



echo "YII_DEBUG".  var_dump(YII_DEBUG);

and it still gives me:

YII_DEBUG: boolean false

when I change:


defined('YII_DEBUG') or define('YII_DEBUG',true/*false*/);

Then it works… [color="#0000FF"]but why can’t I overwrite it!?[/color] ???

Something to do with permissions in "/protected"?


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



…Awesome Bizley, it works like a charm!

Turns out, you can’t redefine a constant at will like a variable without changing your PHP settings. Make sense for a “constant” -_-