centos系统为php安装memcached扩展步骤

前端之家收集整理的这篇文章主要介绍了centos系统为php安装memcached扩展步骤前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. 通过yum安装


yum -y install memcached
#安装完成后执行:
memcached -h
#出现memcached帮助信息说明安装成功

2. 加入启动服务


chkconfig --level 2345 memcached on

3. 配置Memcached


vim /etc/sysconfig/memcached
#文件内容如下,按需要修改:
PORT="11211" #端口
USER="root" #用户名
MAXCONN="1024" #最大连接数
CACHESIZE="64" #内存大小
OPTIONS="" #附加参数

4. 安装libmemached


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. 安装PHP-devel


yum install PHP-devel

6. 安装PHP Memcached扩展


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

猜你在找的Memcache相关文章