我有一个使用Symfony 2.2.1开发的网站。我使用开发环境开发它并且效果很好。问题是当我尝试生产环境时。我收到一个200空的身体。
我的调查:
Symfony在日志中没有写任何内容。
调用 $response = $kernel->handle($request);
,但下一行
$response->send();
不是。这行在app.php文件中
如果我将app.php文件中的$kernel = new AppKernel('prod', false);
替换为$kernel = new AppKernel('prod', true);
,则效果非常好。
我的设置有什么问题?
我已经安装了捆绑包:FOSRestBundle,FOSUser,Sonata-Admin和Sonata-User。
答案 0 :(得分:0)
谢谢@cheesemacfly!日志:
[Wed May 15 18:35:06 2013] [error] [client X.X.X.X] PHP Fatal error: Uncaught exception 'Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException' with message 'The service "sonata.block.renderer.traceable" has a dependency on a non-existent service "debug.stopwatch".' in /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:59\nStack trace:\n#0 /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(43): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processReferences(Array)\n#1 /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(37): Symfony\\Component\\DependencyInjection\\Compiler\\CheckExceptionOnInvalidReferenceBehaviorPass->processDefinition(Object(Symfony\\Component\\DependencyInjection\\Definition))\n#2 /home in /home/inqbarna/ZendProjects/Symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 59
也就是说,Sonata-Admin需要Sonata-block,这个问题就出现了。