Redis Object Cache 2.0使用指南
本文最后更新于 2020年08月12日

Redis Object Cache 2.0后开启不建议使用Predis,其实之前就已经不再推荐使用Predis了(只是这次明文写警告了),Predis很久没有维护过,在新版本的php中存在兼容性问题,官方推荐尽快迁移

What is Predis?
Predis used to be a flexible and feature-complete Redis client for PHP and HHVM, but the library hasn’t been maintained since 2016.
Predis somewhat reliable when using PHP 7.1 and older, but on PHP 7.2 (and newer) warnings and errors will occur.
It is highly recommended to migrate to either PhpRedis or Credis

Predis是什么?
Predis曾经是一个灵活且功能完整的PHP和HHVM Redis客户端,但是这个库从2016年开始就没有维护过。
Predis在使用PHP 7.1和更老版本时比较可靠,但是在PHP 7.2(和更新的版本)上就会出现警告和错误。
强烈建议迁移到PhpRedis或Credis。

迁移的方式很简单,编辑wp-config.php,添加如下内容,不需要关闭redis缓存即可生效,不过最好再刷新一下缓存

/** Redis Object Cache */
define( 'WP_REDIS_CLIENT', 'credis' );
define('WP_REDIS_HOST', 'redis');
define('WP_REDIS_DATABASE', '0');

我推荐用credis,不需要额外安装插件,如果你使用define( 'WP_REDIS_CLIENT', 'phpredis' );,又没安装插件,修改后将无法打开WordPress,修改成define( 'WP_REDIS_CLIENT', 'credis' ); 即可恢复

引用来源:https://github.com/rhubarbgroup/redis-cache/wiki/Predis

原创声明
本文由 NG6 于2020年08月06日发表在 sleele的博客
如未特殊声明,本站所有文章均为原创;你可以在保留作者及原文地址的情况下转载
转载请注明:Redis Object Cache 2.0使用指南 | sleele的博客
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇