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