【问题标题】:What will be "session_memcached_host:" when I use Memcache service provided by Google Cloud Application Flex. Engine?当我使用 Google Cloud Application Flex 提供的 Memcache 服务时,“session_memcached_host:”会是什么。引擎?
【发布时间】:2019-12-06 22:21:32
【问题描述】:

我正在使用 Google Cloud Application Flexible Engine 评估 Symfony 5.0.1。

我无法使用 App Engine 中提供的 Memcache 服务,因为我不知道应该使用哪个“memcached_host”。 Memcache in Application Engine

我尝试在 services.yaml 中使用“session_memcached_host:localhost”,但它不起作用

Symfony 的同一个项目在本地进行了测试,并且它与本地 Memcache 服务器(在我的本地设置中)配合得很好。

【问题讨论】:

  • 您在 App Engine Flex 文档中提到了“App Engine 中提供的 Memcache 服务”。你能详细说明一下吗?您到底想使用哪一个?你关注的是特定的官方教程还是社区教程?
  • 我指的是 App Engine 菜单项中提供的“Memcache”选项,请参考我的问题中的屏幕截图“Memcache in Application Engine”,请参考此链接cloud.google.com/appengine/docs/standard/php/memcache/using

标签: google-cloud-platform memcached app-engine-flexible symfony5


【解决方案1】:

这是 Google App Engine Standard 上的 example of a PHP app using memcache

Here specifically 你可以看到应该如何配置 memcache 以在 App Engine 上工作

我自己尝试了上面的示例,它按预期工作。

注意:您提到了 App Engine Flex,但提供了示例和文档 标准。

Memcache 目前普遍适用于 App Engine 标准版。

请注意,App Engine Flex 和 Standard 之间存在巨大差异。

【讨论】:

【解决方案2】:

我不是 App Engine 专家,但看看下面的示例,您似乎可以直接从您的代码中调用它。一切都是预先配置的,您可以直接从您的代码中调用它。更多信息请参见下面的链接:

https://medium.com/google-cloud/appengine-memcache-service-google-cloud-platform-8214ee9eada1

【讨论】:

  • API 仅适用于 Java 和 Python。 Symfony 基于 PHP,它使用会话处理程序将会话存储在缓存中
猜你喜欢
  • 2021-01-19
  • 1970-01-01
  • 1970-01-01
  • 2020-03-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多