/--- date: 2017-05-22 21:58:43 +0800 categories: 技术 ---/

LEMP环境搭建(五)缓存及其他

Memcached

php中有两个拓展可使用:memcache、memcached。其中memcached拓展提供了功能更为丰富的方法。这 里我将安装此拓展,详情参见官方文档

yum install libmemcached libmemcached-devel
pecl install memcached # 提示输入libmemcached directory [no]时,直接回车
# 安装完成后,根据提示在php.ini文件中加入 extension=memcached.so
systemctl restart php-fpm.service 

# 安装memecached服务
yum install memcached
systemctl enable memcached.service 
systemctl start memcached.service 
systemctl status memcached.service

Redis

这里我将安装phpredis拓展,详情参见官方文档

pecl search redis # 可以查看当前版本
pecl install redis
# 安装完成后,根据提示在php.ini文件中加入 extension=redis.so
systemctl restart php-fpm.service 

#安装redis服务
yum install redis
systemctl enable redis.service
systemctl start redis.service
systemctl status redis.service

ffmpeg

rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install ffmpeg ffmpeg-devel -y

附1:参考

https://www.vultr.com/docs/how-to-install-ffmpeg-on-centos