Enable Debug Component in Symfony 2.3

Before opening a ticket in symfony's repository, I just wanted to check if I had missed something obvious.

I want to enable the debug component (to get these good exception screens, etc.).

I just installed symfony using

composer create-project symfony/framework-standard-edition symfony 2.3.1 

For testing purposes, I added an exception from the WelcomeController:

 class WelcomeController extends Controller { public function indexAction() { throw new \Exception("test"); /* * The action view can be rendered using render() method * or @Template annotation as demonstrated in DemoController. * */ return $this->render('AcmeDemoBundle:Welcome:index.html.twig'); } } 

Instead of showing me the (old) exception screen, I just get 502 Bad Gateway from nginx.

app_dev.php:

 //$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; $loader = require_once __DIR__.'/../app/autoload.php'; Debug::enable(-1); require_once __DIR__.'/../app/AppKernel.php'; $kernel = new AppKernel('dev', true); //$kernel->loadClassCache(); Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response); 

Update:

PHP error handling works, however:

 IDoNotExist(); 

displays the gray symfony error screen.

+2
debugging symfony
Jul 03 '13 at 10:24
source share
1 answer

Well, the problem was in the nginx configuration.

The nginx error log has detected the following:

 2013/07/03 14:33:05 [error] 22792#0: *15 upstream sent too big header while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /test/symfony_2.3.1/web/app_dev.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9111", host: "localhost" 

I installed it with the addition

 fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; 

for server {} in the nginx configuration (for reference http://forum.nginx.org/read.php?2,188352 ). This first happened with 2.3.0, 2.2.3 works without this fix.

Ticket related to this issue: https://github.com/symfony/symfony/issues/8413

+2
Jul 03 '13 at 12:34 on
source share



All Articles