Symfony: disable the web debug toolbar in PROD environment [SOLVED]

According to Symfony documentation, the debug toolbar is disabled in production environment (this is, /Symfony/web/app.php/WHATEVS).

Well, mine (Symfony 2.0.13 running on top of a WAMP2.2 server) was not. It was active no matter the url I was using (app.php or app_dev.php). Irritating.

To disable it, edit web/app.php and change from:

$kernel = new AppKernel('prod', false);

To

$kernel = new AppKernel('prod', true);

Why is that?

AppKernel class extends Kernel class, and take a look at its constructor, more precisely to the second parameter:

public __construct(string $environment, Boolean $debug)
 
Constructor.
 
Parameters
string 	$environment 	The environment
Boolean 	$debug 	Whether to enable debugging or not

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation