在App Engine上部署Symfony Hello World


Deploying Symfony Hello World on App Engine

我遵循官方谷歌教程'如何运行Symfony Hello World上的应用引擎'关于如何部署https://github.com/GoogleCloudPlatform/symfony-standard.git

我已经设置了默认的云存储桶,但我还没有设置SQL数据库,因为我没有使用学说在这一点上。

当使用GoogleAppEngineLauncher在本地运行应用程序时,显示以下错误:

Fatal error: Uncaught exception 'InvalidArgumentException' with message '[WARNING 1549] failed to load external entity "file:////Users/gl/Repos/symfony-standard/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd" (in n/a - line 0, column 0) [WARNING 3084] Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'file:////Users/gl/Repos/symfony-standard/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd'. Skipping the import. (in in_memory_buffer - line 8, column 0) [ERROR 1845] Element '{http://symfony.com/schema/dic/services}container': No matching global declaration available for the validation root. (in /Users/gl/Repos/symfony-standard/web/ - line 5, column 0)' in /Users/gl/Repos/symfony-standard/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:96 Stack trace: #0 /Users/gl/Repos/symfony-standard/vendor/symfony/symfony/src/Symfony/Compone in /Users/gl/Repos/symfony-standard/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php on line 234

当部署到AppEngine时,在显示正确的输出"主页"之前会显示以下错误:

Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/monolog-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/monolog-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/monolog-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/swiftmailer-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/swiftmailer-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/swiftmailer-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/assetic-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/assetic-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/symfony/assetic-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/doctrine/doctrine-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/doctrine/doctrine-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/doctrine/doctrine-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/sensio/framework-extra-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/sensio/framework-extra-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/vendor/sensio/framework-extra-bundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/src/AppBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/src/AppBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Warning: opendir(/base/data/home/apps/e~sy-be/1.306537434952097690/src/AppBundle/Resources/config/doctrine): failed to open dir: No such file or directory in /base/data/home/runtimes/php/sdk/google/appengine/runtime/Glob.php on line 124 Homepage.

我不明白我做错了什么

尝试运行app/console server:run ..你应该不会有任何问题的。

这是因为Google Apps Engine在默认情况下有一个只读文件系统。

你的文件"stream"/"handler"是前缀"gs://myfiles"而不是传统的"file://tmp/.

Symfony2"标准"在与Google App Engine一起部署时被破坏(Symfony需要能够创建缓存文件,类映射等)。

我建议从https://cloud.google.com/appengine/docs/php/googlestorage/

的速成班开始。

这个包看起来像是抽象文件系统的一个不错的例子:https://github.com/KnpLabs/Gaufrette ..我将很快测试这个,并保持你的消息。

你没有做错任何事。谷歌应用引擎启动器的PHP运行时有一个问题。在修复之前,解决这个问题的最佳方法是编辑Symfony'Component'DependencyInjection'Loader'XmlFileLoader类,并使函数"validateSchema"返回true。

编辑

以上是指您在本地遇到的问题("Failed to load external entity")。为了解决你的第二个问题,我相信清除缓存(使用这里指定的/clear_cache URL)将解决这个问题。