我正在关注如何部署How to Run Symfony Hello World on App Engine的官方Google教程“https://github.com/GoogleCloudPlatform/symfony-standard.git”
我已经设置了默认的云存储桶,但我没有设置SQL数据库,因为此时我还没有使用doctrine。
使用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.
我不明白我做错了什么..
答案 0 :(得分:0)
你没有做错任何事。 Google App Engine Launcher的PHP运行时存在问题。在修复之前,解决问题的最佳方法是编辑Symfony\Component\DependencyInjection\Loader\XmlFileLoader
类并使函数" validateSchema"返回true。
修改强>
以上是指您在本地遇到的问题("无法加载外部实体" )。为了解决您的第二个问题,我认为清除缓存(使用指定的/clear_cache
网址here)将解决问题。
答案 1 :(得分:0)
尝试运行app / console服务器:运行..你不应该有任何问题..
这是因为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 ..我将很快对此进行测试并保持你的发布。