2016-11-28 44 views
0

在設置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$ 

任何線索如何我可以使用這些信息來解決我的問題,特別是在日誌上?

回答

0

我已經能夠通過運行應用程序/控制檯資源來解決此問題:在開發環境(app/console cache:clear)中安裝和清除緩存。於是,我不得不處理以下異常:在ClassCollectionLoader.php線239

的RuntimeException:無法寫入緩存文件「/var/www/html/app/cache/dev/classes.php」。

其中我按照此處提供的說明保留:http://symfony.com/doc/2.7/setup/file_permissions.html

對於Linux系統:

$ rm -rf app/cache/* 
$ rm -rf app/logs/*  

$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data| 

[n]ginx' | grep -v root | head -1 | cut -d\ -f1` 
# if this doesn't work, try adding `-n` option 
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs 
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs 
相關問題