1

我有一个用 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。

4

1 回答 1

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 而这个有问题。

于 2013-05-15T16:55:27.397 回答