yum安装php5.6 memcache,CentOS6.5安装为PHP安装memcached扩展

本文指导如何在CentOS 6.5的PHP 5.6.21环境中通过yum安装libmemcached和memcached扩展,包括下载、配置和编译步骤,确保了memcached功能在重启php-fpm后正常启用。
摘要由CSDN通过智能技术生成

PHP环境版本CentOS6.5的PHP版本为5.6.21通过yum方式安装的, memcache扩展已经通过yum 方式安装好了

首先需要下载并安装libmemcached

因为memcached扩展是基于libevent的事件处理的, 首先需要安装libmemcached

下载地址

解压并安装:tar zxf libmemcached-1.0.18.tar.gz

cd libmemcached-1.0.18

./configure --prefix=/usr/local/libmemcached --with-memcached//注意:--with-memcached这个选项一定要加上

make

make install

注意:如果需要适用sasl, 也可以在安装libmemcahced前安装cyrus-sasl-devel:yum install cyrus-sasl-devel

安装memcached扩展

首先下载memcached扩展, 下载地址

解压并安装:tar zxf memcached-2.2.0.tgz

cd zxf memcached-2.2.0

phpize

./configure --with-php-config=/usr/bin/php-config --disable-memcached-sasl --with-libmemcached-dir=/usr/local/libmemcached

make

make test

make install

注意:如果不使用--disable-memcached-sasl安装过程中会提示error 'configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check '

至此php的memcached扩展安装完毕, 重启php-fpm 即可生效。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值