memcache缓存技术应用
1、1. 安装memcache
在linux系统中安装memcache

2、2.
上传软件到linux系统:

1、一.安装libevent
安装libevent命令:
shell# tar zxvf libevent-2.0.21-stable.tar.gz
shell# cd libevent-2.0.21-stable
shell# ./configure --prefix=/usr/local/libevent
shell# make
shell# make install
至此libevent安装完毕;
二.安装memcache服务软件
安装memcached命令:
shell# tar zxvf memcached-1.4.25.tar.gz
shell# cd memcached-1.4.25
shell# ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/
shell# make
shell# make install
至此memcached安装完毕;

2、2.
启动memcache服务

1、1.
下图,在memcache解压目录里边执行phpize
php的扩展(依赖):gd、xml、pdo、mysql、memcache、redis、mb_string等等
软件本身、依赖软件的安装顺序:先依赖软件、再软件本身
目前的情况是,php软件本身已经安装完毕,但是我们还想给其安装memcache扩展,
显然,软件安装顺序出现问题。
现在技术在提高,扩展软件后安装也可以成为php的扩展功能(php不需要重复安装)
必要步骤:扩展软件安装的时候先执行一次/usr/local/php/bin/phpize

2、2.
php安装memcache扩展
安装memcache-2.2.7.tar
shell# tar xvf memcache-2.2.7.tar
shell# cd memcache-2.2.7
shell# /usr/local/php/bin/phpize
shell#./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
shell# make && make install


3、3.php.ini开启memcache扩展

4、4.重启apache.

5、5.
给php安装memcache成功:

1、1.
memcache项目中的应用代码编写。


