its actually security critical to do anything wild like that in the core.php, it has to be and stay always 0 for ALL user frontend sites.
If you want to enable it for some admin backend action, you can do that inside the action at the very beginning with
Configure::write('debug', 2);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…