title: Symfony environments and debug bar
body: <p>I am new to Symfony. Been doing some tests (Symfony 2.0.13 with php5.3.8 in WAMP2.2) and reading <a href="http://symfony.com/doc/current/book/internals.html#configuration" rel="nofollow">the</a> <a href="http://symfony.com/doc/current/cookbook/configuration/environments.html" rel="nofollow">documentation</a> but I am kind of  confused with environments.</p>
  
  <p>When I go to <code>LOCALHOST/Symfony/web/app_dev.php/demo/hello/Foo</code> (app_dev means development environment, right?) I can see the web debug toolbar and clicking in the profiler info, in the "project configuration" tab, I can see:
  <em>Environment    dev</em></p>
  
  <p>Now I go to <code>LOCALHOST/Symfony/web/app.php/demo/hello/Foo</code> and in the web debug toolbar (BTW, why I am seeing this toolbar now? Ain't this a production environment? Are my users supposed to see this bar by default?) I also see, in the "project configuration" tab:
  <em>Environment    dev</em></p>
  
  <p>It seems that this "demo" Bundle is somehow associated with "dev", no matter what the URL is app_dev.php or app.php??</p>
  
  <p>Moreover, I did some more tests: my local IP is 192.168.153.1. </p>
  
  <p>When I try to access:</p>
  
  <pre><code>http://192.168.153.1/Symfony/web/app_dev.php/demo/hello/Foo
  </code></pre>
  
  <p>it says "You are not allowed to access this file. Check app_dev.php for more information." So, ok, if I edited the lines in app_dev.php and added my (external) IP, I could access.</p>
  
  <p>BUT, when I connect to </p>
  
  <pre><code>http://192.168.153.1/Symfony/web/app.php/demo/hello/Foo
  </code></pre>
  
  <p>IT SAYS THE SAME! So it seems that my app.php is not being executed, and app_dev.php is being executed no matter what I type in the URL.</p>
  
  <p>This is really confusing! I checked my htaccess and everything seems to be right.</p>
  
  <p>Can anyone help me figure this out?</p>
  
  <p>I have NOT modified the code for app_dev.php neither app.php, everything is just "as is" out of the box.</p>
  
  <hr>
  
  <p>2012-05-02 EDIT</p>
  
  <p>Something weird happened. I edited my config_prod.yml with these lines:</p>
  
  <pre><code># load the profiler
  framework:
      profiler: { only_exceptions: false }
  
  # enable the web profiler
  web_profiler:
      toolbar: true
      intercept_redirects: true
      verbose: true
  </code></pre>
  
  <p>Saved, and then edited the app.php file. Wanted to test what happened if I changed:</p>
  
  <pre><code>$kernel = new AppKernel('prod', false); //Symfony default
  </code></pre>
  
  <p>To</p>
  
  <pre><code>$kernel = new AppKernel('prod', true);
  </code></pre>
  
  <p>When I went to app.php/WHATEVER, an error page appeared, so I reverted all changes, restarted Apache and now the WebDebug Toolbar is not showing anymore in PROD (app.php/WHATEVER)</p>
  
  <p>So, I don't know how, but it seems to work as expected now, although the config_prod.yml file and the app.php are in the original state. It also allows me to connect with my external IP to app.php</p>
  
  <p>REALLY weird...</p>