【问题标题】:How to configure Laravel with memcache on App Engine?如何在 App Engine 上使用 memcache 配置 Laravel?
【发布时间】:2023-03-20 09:51:01
【问题描述】:

我将 Laravel 网站上传到 Google App Engine,但无法登录,因为会话不起作用。

app/config/cache.phpapp/config/session.php,我改了:

'driver' => 'memcached',

但是在cache.php,我看到了:

/*
|--------------------------------------------------------------------------
| Memcached Servers
|--------------------------------------------------------------------------
|
| Now you may specify an array of your Memcached servers that should be
| used when utilizing the Memcached cache driver. All of the servers
| should contain a value for "host", "port", and "weight" options.
|
*/

'memcached' => array(

    array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),

),

'host' => '127.0.0.1' 是我的问题的原因还是其他原因?

[更新]当我尝试使用时

'driver' => 'file',

会话文件存储在<bucket-name>/storage/session。会话已创建并存储,但来自Server:Google FrontendResponse Headers 不包含sessionId

【问题讨论】:

标签: php google-app-engine session laravel memcached


【解决方案1】:

Google App Engine 上的 Memcache 服务与标准的 memcached 并不完全相同,因此您将无法直接在 App Engine 上运行诸如 Laravel 之类的应用程序,而无需对其进行调整以适应该环境。具体来说,没有可供您连接的主机名、IP 或端口直接公开 memcached API。

幸运的是,其他人已经这样做了,所以你可以使用他们的劳动成果,即看看Laravel 4 on Google AppEngine for PHPdiscussion on laravel.io,它引用了上面的教程,也指向了GAE adapter package for Laravel apps

请注意,我还没有尝试过,但看起来它应该适合你;请在作者发布作品的表单上发布后续问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-14
    • 2012-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-29
    相关资源
    最近更新 更多