CentOS 7安装redis及php扩展
生活随笔
收集整理的這篇文章主要介紹了
CentOS 7安装redis及php扩展
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
安裝remi源
# wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # rpm -Uvh remi-release-7.rpm # sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/remi.repo確認(rèn)使用remi源時(shí)安裝的Redis版本。
安裝Redis
使用remi源yum安裝Redis。
# yum install redis --enablerepo=remi確認(rèn)Redis版本。
# redis-server --version修改Redis配置文件/etc/redis.conf
想以服務(wù)形式使用Redis因此進(jìn)行daemonize參數(shù)從no改為yes。
/etc/redis.confRedis重要特點(diǎn)就是數(shù)據(jù)的持久性,Redis保存數(shù)據(jù)的方法RDB文件(RDB=Redis DataBase?)及AOF(Append Only File),可同時(shí)使用RDB文件保存及AOF。RDB文件保存目錄是參數(shù)dir指定的目錄。
# save <seconds> <changes> # Will save the DB if both the given number of seconds and the given # In the example below the behaviour will be to save: # Note: you can disable saving completely by commenting out all "save" lines. # It is also possible to remove all the previously configured save # points by adding a save directive with a single empty string argument # save "" save 900 1 # 15分鐘之內(nèi)有一次變更時(shí)進(jìn)行保存 save 300 10# 5分鐘之內(nèi)有10次變更時(shí)進(jìn)行保存 save 60 10000# 1分鐘之內(nèi)有10000次變更時(shí)進(jìn)行保存redis-cli 命令 命令行打開(kāi)客戶(hù)端
安裝php-redis擴(kuò)展及簡(jiǎn)單使用
轉(zhuǎn)載于:https://www.cnblogs.com/yanyuxuxing/p/6288114.html
總結(jié)
以上是生活随笔為你收集整理的CentOS 7安装redis及php扩展的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: quagga源码分析--路由信息处理ze
- 下一篇: 4种常见的 PHP 设计模式