整理一下,把memcache安装过程收集起来存为shell脚本。方便以后安装服务。
#~ file: memcache.sh
#~ power by yagas60@21cn.com
#~ blog: http://blog.csdn.net/yagas
yum -y install libevent-devel
wget http://memcached.googlecode.com/files/memcached-1.4.7.tar.gz -O /tmp/memcached-1.4.7.tar.gz
tar -xzvf /tmp/memcached-1.4.7.tar.gz -C /tmp
cd /tmp/memcache-1.4.7
./configure --prefix=/usr/local/memcache --with-libevent=/usr
make
make install
ln -s /usr/local/memcache/bin/memcached /usr/local/bin/memcached
wget http://pecl.php.net/get/memcache-3.0.6.tgz -O /tmp/memcache-3.0.6.tgz
tar -xzvf /tmp/memcache-3.0.6.tgz -C /tmp
cd /tmp/memcache-3.0.6
phpize
./configure --with-php-config=/usr/bin/php-config --with-zlib-dir=/usr
make
make install
sed 's/; extension_dir = ".\/"/extension_dir = "\/usr\/lib\/php\/modules"/' /etc/php.ini|sed 's/; default extension directory./; default extension directory.\nextension=memcache.os/' > /tmp/php.ini
mv -f /tmp/php.ini /etc/php.ini