菜鸟求问,tp5 怎么配置redis

2026年09月24日 21:23
有1个网友回答
网友(1):

在appcation/extra目录添加cache.php文件,内容如下:

return [
    // 驱动方式
    'type' => 'redis',
    'host' => '127.0.0.1',
    'port' => '6379',
    'password' => '',
    // 缓存前缀
    'prefix' => '',
    // 缓存有效期 0表示永久缓存
    'expire' => 0,
];