我正在关注Google官方教程“ 如何在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.
我不明白我在做什么错..
你没做错什么 Google App Engine启动器的PHP运行时中存在一个问题。 解决此问题之前,解决此问题的最佳方法是编辑Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader
类,并使函数“ validateSchema”返回true。
编辑
上面是指您在本地遇到的问题( “无法加载外部实体” )。 为了解决您的第二个问题,我相信清除缓存(使用此处指定的/clear_cache
URL)将解决此问题。
尝试运行应用程序/控制台服务器:运行..您应该没有任何问题。
这是因为Google Apps Engine默认情况下具有只读文件系统。
您的文件“ stream” /“ handler”是前缀“ gs:// myfiles”,而不是传统的“ file:/// tmp /”。
与Google App Engine一起部署时,Symfony2“标准”已损坏(Symfony必须能够创建缓存文件,类映射等。)。
我建议您从https://cloud.google.com/appengine/docs/php/googlestorage/上的速成班开始
这个捆绑包看起来像是一个不错的快照,可以抽象出文件系统: https : //github.com/KnpLabs/Gaufrette ..我将在短期内对此进行测试并保持最新状态。