memcache 是一个高性能的分布式的内存对象缓存系统,通过在内存中维护一张统一的、巨大的 Hash 表,它能够用来存储各种格式的数据,包括图像、视频、文件及数据库检索的结果等。简单地说就是将数据调用到内存中,然后从内存中读取,从而大大提高读取速度。
大家需要注意,memcache 有两个软件:
- memcache-3.0.8 是 memcache 模块,也就是客户端;
- memcached-1.4.17 是 memcache 服务器端。
memcache客户端安装
[root@localhost src]# yum -y install zlib-devel
#安装底层依赖包zlib-devel
[root@localhost src]# cd /usr/local/src/memcache-3.0.8
#进入memcache-3.0.8解压缩目录
[root@localhost memcache-3.0.8]# /usr/local/php/bin/phpize
#用phpize加载memcache模块。这条命令一定要进入memcache目录才能正确执行
[root@localhost memcache-3.0.8]# ./configure –with-php-config=/usr/local/php/bin/php-config
#编译前配置。指定php-config文件的位置
[root@localhost memcache-3.0.8]# make
#编译
[root@localhost memcache-3.0.8]# make install
#编译安装
memcache服务器端安装
接下来该安装 memcached-1.4.17 这个服务器端程序了,命令如下&#