在设置Web环境(Apache2,MySQL,PHP7)后,我刚刚在AWS账户(在使用Ubuntu 16.04的EC2实例上)部署了基于Symfony2的应用程序。 Ubuntu /var/www/html/index.html默认文件被正确渲染。但是当谈到Symfony2时,我的app.php和app_dev.php都有一个空白页面。当我使用Filezilla调试工具进行测试时,可以看到出现“500 Internal Server Error”错误消息。 Symfony2 config.php表明现在一切正常,我只需要在php.ini中添加date.timezone值即可。我的.htaccess文件配置得很好,因为我使用的是与之前设置的其他基于Symfony2的网站相同的模型。使用Symfony2应用程序的空白页
这是我对/logs/dev.log:
[2016-11-27 18:23:09] event.DEBUG: Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". [] []
[2016-11-27 18:23:09] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
[2016-11-27 18:23:09] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
[2016-11-27 18:23:09] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onTerminate". [] []
[2016-11-27 18:23:09] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
[2016-11-27 18:23:09] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
[2016-11-27 18:39:22] event.DEBUG: Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". [] []
[2016-11-27 18:39:22] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
[2016-11-27 18:39:22] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
[2016-11-27 18:39:22] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onTerminate". [] []
[2016-11-27 18:39:22] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
[2016-11-27 18:39:22] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
[2016-11-28 00:44:05] event.DEBUG: Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". [] []
[2016-11-28 00:44:05] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
[2016-11-28 00:44:05] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". [] []
[2016-11-28 00:44:05] php.DEBUG: The Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\DebugHandlerPass class is deprecated since version 2.12 and will be removed in 3.0. Use AddDebugLogProcessorPass in FrameworkBundle instead. {"type":16384,"file":"/var/www/html/vendor/symfony/monolog-bundle/DependencyInjection/Compiler/DebugHandlerPass.php","line":14,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Passing a string as the $source argument of Twig_Environment::tokenize() is deprecated since version 1.27. Pass a Twig_Source instance instead. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":604,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Defining the initRuntime() method in the "form" extension is deprecated since version 1.23. Use the `needs_environment` option to get the Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig_Extension_InitRuntimeInterface if needed (not recommended). {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/Environment.php","line":794,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in WebProfilerBundle:Collector:form.html.twig at line 611. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 205. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 323. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 325. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 337. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 339. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 351. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] php.DEBUG: Twig Test "sameas" is deprecated since version 1.21. Use "same as" instead in form_div_layout.html.twig at line 353. {"type":16384,"file":"/var/www/html/vendor/twig/twig/lib/Twig/ExpressionParser.php","line":646,"level":4352} []
[2016-11-28 00:44:06] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onTerminate". [] []
[2016-11-28 00:44:06] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
[2016-11-28 00:44:06] event.DEBUG: Notified event "console.terminate" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onTerminate". [] []
我还检查/var/log/apache2/error.log:
[Mon Nov 28 06:25:02.181251 2016] [mpm_prefork:notice] [pid 13742] AH00163: Apa$
[Mon Nov 28 06:25:02.181268 2016] [core:notice] [pid 13742] AH00094: Command li$
[Mon Nov 28 09:34:27.731905 2016] [:error] [pid 18830] [client 41.251.22.4:4926$
[Mon Nov 28 09:34:27.732394 2016] [:error] [pid 18830] [client 41.251.22.4:4926$
[Mon Nov 28 09:35:51.425233 2016] [:error] [pid 18832] [client 41.251.22.4:5048$
[Mon Nov 28 09:38:09.621647 2016] [:error] [pid 18829] [client 41.251.22.4:5103$
[Mon Nov 28 09:38:09.621901 2016] [:error] [pid 18829] [client 41.251.22.4:5103$
[Mon Nov 28 09:46:16.528434 2016] [:error] [pid 18831] [client 41.251.22.4:2130$
[Mon Nov 28 09:46:16.528644 2016] [:error] [pid 18831] [client 41.251.22.4:2130$
[Mon Nov 28 09:48:41.956055 2016] [:error] [pid 18832] [client 41.251.22.4:5224$
[Mon Nov 28 09:48:41.956345 2016] [:error] [pid 18832] [client 41.251.22.4:5224$
[Mon Nov 28 09:49:06.614155 2016] [:error] [pid 18829] [client 41.251.22.4:5228$
[Mon Nov 28 09:49:06.614356 2016] [:error] [pid 18829] [client 41.251.22.4:5228$
[Mon Nov 28 10:07:58.290011 2016] [:error] [pid 18831] [client 41.251.22.4:5284$
[Mon Nov 28 10:07:58.290215 2016] [:error] [pid 18831] [client 41.251.22.4:5284$
[Mon Nov 28 10:09:25.032732 2016] [:error] [pid 21233] [client 41.251.22.4:5287$
[Mon Nov 28 10:09:25.032947 2016] [:error] [pid 21233] [client 41.251.22.4:5287$
[Mon Nov 28 10:09:44.034353 2016] [:error] [pid 18829] [client 41.251.22.4:5288$
[Mon Nov 28 10:09:44.034556 2016] [:error] [pid 18829] [client 41.251.22.4:5288$
任何线索如何我可以使用这些信息来解决我的问题,特别是在日志上?