【发布时间】:2019-02-20 08:04:09
【问题描述】:
我正在尝试在 Google Cloud 上部署 Symfony 4.2。 使用本教程: https://cloud.google.com/community/tutorials/run-symfony-on-appengine-flexible
它部署没有错误,但是当我尝试访问它时,它给了我 500。 来自 Google 的日志:
2019-02-20 07:53:36 default[20190220t093729] #0 /app/vendor/symfony/http-kernel/Config/FileLocator.php(52): Symfony\Component\Config\FileLocator->locate('../src/Controll...', '/app/config', true)
2019-02-20 07:53:36 default[20190220t093729] #1 /app/vendor/symfony/config/Loader/FileLoader.php(110): Symfony\Component\HttpKernel\Config\FileLocator->locate('../src/Controll...', '/app/config', true)
2019-02-20 07:53:36 default[20190220t093729] #2 /app/vendor/symfony/dependency-injection/Loader/FileLoader.php(126): Symfony\Component\Config\Loader\FileLoader->glob('', true, NULL, false, false, Array)
2019-02-20 07:53:36 default[20190220t093729] #3 /app/vendor/symfony/dependency-injection/Loader/FileLoader.php(57): Symfony\Component\DependencyInjection\Loader\FileLoader->findClasses('App\\Controller\\', '../src/Controll...', Array)
2019-02-20 07:53:36 default[20190220t093729] #4 /app/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php(554): Symfony\Component\DependencyInjection\Loader\FileLoade" while reading response header from upstream, client: 172.17.0.4, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "placechecker-231507.appspot.com"
2019-02-20 07:53:36 default[20190220t093729] 172.17.0.4 - - [20/Feb/2019:07:53:36 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/72.0.3626.96 Chrome/72.0.3626.96 Safari/537.36"
2019-02-20 07:54:36 default[20190220t093729] 2019/02/20 07:54:36 [info] 9#9: *6 client 172.17.0.4 closed keepalive connection
我尝试了另一个安装演示 symfony 应用程序的现有教程,这不是我想要的,但它几乎可以工作,除了它不加载 CSS 和 JS。 https://cloud.google.com/community/tutorials/run-symfony-on-appengine-standard
任何如何调试它的想法都会有所帮助。
编辑:
在开发模式下部署后出现此错误:
(1/1) ClassNotFoundException
Attempted to load class "WebProfilerBundle" from namespace "Symfony\Bundle\WebProfilerBundle".
Did you forget a "use" statement for another namespace?
in Kernel.php line 23
at Kernel->registerBundles()
in Kernel.php line 424
at Kernel->initializeBundles()
in Kernel.php line 130
at Kernel->boot()
in Kernel.php line 193
at Kernel->handle(object(Request))
in index.php line 25
【问题讨论】:
-
您能否在开发模式下部署该应用程序,以便获得完整的堆栈跟踪?给定的缺少确切的错误消息
-
感谢提示在编辑中添加了错误。
-
....您在阅读了该错误消息后做了什么?它不是已经提供了一些信息吗?
-
网上查到这可能是缓存造成的。于是,删除了缓存,重新部署,但还是不行,还是报同样的错误。
-
你能检查有问题的类是否存在于实时服务器上吗?
标签: php google-cloud-platform symfony4