centos 5.5 安装 memcached 手记

本文详细介绍了在遇到Memcached安装与配置错误时的排查步骤及解决方案,包括解决缺少ZLIB依赖、正确配置参数等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


pecl install memcached
出现错误:
ERROR: `/var/tmp/memcached/configure' failed

memcached 安装参考http://www.cnblogs.com/zgx/archive/2011/08/10/2134097.html

pecl install memcache

出现错误

只能编译安装:
wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz

var memcached-1.4.5.tar.gz

cd memcached-1.4.5

./configure

又出错:configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located

说缺少ZLIB

那就安装zlib

yum install zlib-devel -y

安装 libevent 

yum install  libevent libevent-devel -y

安装完毕之后,顺利./configure

./configure

make

make install

vi /etc/php.d/memcache.ini

粘贴以下内容



extension=memcache.so
; Options for the memcache module
; Whether to transparently failover to other servers on errors
memcache.allow_failover=1
; Defines how many servers to try when setting and getting data.
memcache.max_failover_attempts=20
; Data will be transferred in chunks of this size
memcache.chunk_size=8192
; The default TCP port number to use when connecting to the memcached server
memcache.default_port=11211
; Hash function {crc32, fnv}
memcache.hash_function=crc32
; Hash strategy {standard, consistent}
memcache.hash_strategy=standard

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值