简体   繁体   English

在App Engine运行时PHP 7.2上启用Memcached

[英]Enable Memcached on App Engine runtime PHP 7.2

I'm trying since several days to enable session storage in memcache on Google App Engine, using the Symfony framework. 自几天以来,我一直在尝试使用Symfony框架在Google App Engine的内存缓存中启用会话存储。 Application starts well, Memcached instance exists, but I always end up with sessions that are not stored (CSRF on all forms, etc). 应用程序启动良好,Memcached实例存在,但我总是以未存储的会话(所有形式的CSRF等)结束。

So I've created a very simple POC to check if Memcached is working, and it actually doesn't. 因此,我创建了一个非常简单的POC,以检查Memcached是否正常工作,而实际上却没有。

Here's the POC code: 这是POC代码:

app.yaml app.yaml

runtime: php72

resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

php.ini php.ini

extension=memcached.so

index.php index.php

<?php

$test = new \Memcached;
var_dump( $test->add('test', '42') );
echo 'value of test is: ', $test->get('test');

Result of the following code is: 以下代码的结果是:

bool(false) value of test is: 测试的bool(false)值为:

Memcache looks pretty well integrated to App Engine, so I'm wondering why I can't hit it. Memcache与App Engine集成良好,因此我想知道为什么我无法实现它。


Debugging Memcached, the error is the following: 调试Memcached,错误如下:

(0x75b27c3c040) NO SERVERS DEFINED -> libmemcached/initialize_query.cc:58 (0x75b27c3c040)未定义服务器-> libmemcached / initialize_query.cc:58

Any idea how to configure it properly? 知道如何正确配置吗?

php72不支持Memcache,如果您需要访问memcache,则必须使用php55

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM