Memcache安装步骤

================================Start 安装Memcache Start================================
+------------------------------------+
1.安装libevent
+------------------------------------+
yum -y install libevent libevent-devel

+------------------------------------+
2.安装memcached
+------------------------------------+
cd /lamp/setup
tar -zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure
make
make install

+------------------------------------+
3.启动memcached服务
+------------------------------------+
/usr/local/bin/memcached -u root -p 11211 -m 128m -d

-u:运行memcache的用户
-p:设置memcache监听的端口
-m:分配给memcache使用的内存
-d:指作为daemon在后台启动

+------------------------------------+
4.查看启动是否成功
+------------------------------------+
netstat -tunlp | grep memcache

+------------------------------------+
5.安装memcache
+------------------------------------+
cd /lamp/setup
tar -zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/lamp/php/bin/phpize
./configure --enable-memcache --with-php-config=/lamp/php/bin/php-config --with-zlib-dir
make
make install
cd ../

+------------------------------------+
6.修改php.ini
+------------------------------------+
vi /lamp/php/etc/php.ini
php.ini输入以下内容:
+------------
extension=memcache.so
------------+

+------------------------------------+
7.memcache.so放入php/extensions 或 修改php.ini中extension_dir路径
+------------------------------------+

+------------------------------------+
8.重启httpd,测试
+------------------------------------+
================================End 安装Memcache End================================

你可能感兴趣的:(职场,memcache,libevent,休闲)