CentOS6.9yum安装memcached和php-memcached扩展

首先确认仓库中是否存在memcached和libmemcached以及php-pecl-memcached,如果没有需要设置yum源
1.安装memcached

yum install memcached

2.验证安装

memcached -h
/etc/rc.d/init.d/memcached status

3.查看配置文件

[root@jmsite ~]# cat /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""

4.启动memcached

/etc/rc.d/init.d/memcached start
#设置开机启动
chkconfig memcached on

5.安装libmemcached

yum install libmemcached

6.安装php-pecl-memcached扩展

yum install php-pecl-memcached

7.重启php,查看phpinfo();