1. Installation via Yum
Copy Code code as follows:
Yum-y Install memcached
#安装完成后执行:
Memcached-h
#出现memcached帮助信息说明安装成功
2. Join Start Service
Copy Code code as follows:
Chkconfig--level 2345 memcached on
3. Configure memcached
Copy Code code as follows:
Vim/etc/sysconfig/memcached
#文件中内容如下, modify as needed:
Port= "11211" #端口
user= "Root" #用户名
maxconn= "1024" #最大连接数
The "cachesize=" #内存大小
Options= "" #附加参数
4. Install libmemached
Copy Code code as follows:
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
TAR-ZXVF libmemcached-1.0.16.tar.gz
CD libmemcached-1.0.16
./configure-prefix=/usr/local/libmemcached-with-memcached
Make && make install
5. Install Php-devel
Copy Code code as follows:
6. Install php memcached Extension
Copy Code code as follows:
wget http://pecl.php.net/get/memcached-2.1.0.tgz
TAR-ZXVF memcached-2.1.0.tgz
CD memcached-2.1.0
/usr/local/php/bin/phpize
./configure-enable-memcached-with-php-config=/usr/local/php/bin/php-config-with-zlib-dir-with-libmemcached-dir =/usr/local/libmemcached-prefix=/usr/local/phpmemcached
Make && make install