Centos 6.x 系统下用yum安装Memcache

时间:2023-03-08 22:53:53
Centos 6.x 系统下用yum安装Memcache

我们的第一步就是导入第三方软件仓库RPMForge ,首页进行centos 官网找到RPMForge下载地址

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge/

由于32位和64位系统下载包不一样,所以你先要确认你系统32位还是64位,可以通过以下命令查看

getconf LONG_BIT

然后根据返回值,选择下载地址

32位系统下载地址:

#wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
64位系统下载地址
#wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
可以会提示以下错误,是网络连接中断,重复执行一次就可以了。
Resolving rpmforge.sw.be... failed: Name or service not known.
wget: unable to resolve host address `rpmforge.sw.be'

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 
#rpm -ivh rpmforge-release-*.rpm
搜索一下相关安装包:
yum search memcache
 
开始安装
#yum -y install –enablerepo=rpmforge memcached php-pecl-memcache
 
验证一下安装结果,返回版本、参数等信息
#memcached –h
 
加入到php
#php -m|grep memcache
 

设置开机启动

#chkconfig memcached on
 

启动memcached

#service memcached start