将 CI 4 部署到 Google App Engine Standard 时配置缓存

Configure Cache when Deploying CI 4 to Google App Engine Standard

提问人:DanielAttard 提问时间:11/18/2023 最后编辑:DanielAttard 更新时间:11/18/2023 访问量:6

问:

我有一个 Codeigniter 3 应用程序目前部署到 Google App Engine (Standard)。最近我开始看到以下警告:

WARNING: PHP 7.4 is no longer supported by the PHP community as of 28 November, 2022. PHP 7.4 will be end of support on 2024-01-30. As of 2024-01-30 you will no longer be able to deploy your App Engine Standard using php74. We recommend you to upgrade to the latest version of PHP as soon as possible.

似乎为了继续部署到 Google App Engine(标准版),我需要将我的应用程序迁移到 Codeigniter 4 和 PHP 8.1。我知道在 Google App Engine (Standard) 中,您可以将文件读取和写入名为的目录,并且该目录中的文件存储在 RAM 中。/tmp

public array $file = [
        'storePath' => WRITEPATH . 'cache/',
        'mode'      => 0640,
    ];

我尝试将可写路径设置为几种不同的变体,但这些似乎都不起作用:

'storePath' = '/tmp/',                 # incorrect path 1 
'storePath' = '/tmp/cache/',           # incorrect path 2 
'storePath' = '/workspace/tmp/',       # incorrect path 3 
'storePath' = '/workspace/tmp/cache/', # incorrect path 4 

这是我在 Google App Engine 中收到的错误消息,它无法写入缓存:

PHP message: PHP Fatal error:  Uncaught CodeIgniter\Cache\Exceptions\CacheException: Cache unable to write to "/workspace/tmp/cache/". in /workspace/vendor/codeigniter4/framework/system/Cache/Handlers/FileHandler.php:66

有人可以帮我了解我做错了什么吗?部署到 Google App Engine (Standard) 时,在 CI 4 中配置缓存的正确方法是什么?

php codeigniter 缓存 memcached codeigniter-4

评论


答: 暂无答案