用的这个方法:
tar vxzf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/webserver/php/bin/phpize
./configure –enable-memcache –with-php-config=/usr/local/webserver/php/bin/php-config –with-zlib-dir
make
make install
到make这一步出错!
这是ssh的错误提示:
[root@200416 memcache-2.2.5]# make && make install
/bin/sh /usr/local/src/memcache-2.2.5/libtool –mode=compile cc -I/usr/include/p hp -I. -I/usr/local/src/memcache-2.2.5 -DPHP_ATOM_INC -I/usr/local/src/memcache- 2.2.5/include -I/usr/local/src/memcache-2.2.5/main -I/usr/local/src/memcache-2.2 .5 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/inc lude/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CON FIG_H -g -O2 -c /usr/local/src/memcache-2.2.5/memcache.c -o memcache.lo
mkdir .libs
cc -I/usr/include/php -I. -I/usr/local/src/memcache-2.2.5 -DPHP_ATOM_INC -I/usr /local/src/memcache-2.2.5/include -I/usr/local/src/memcache-2.2.5/main -I/usr/lo cal/src/memcache-2.2.5 -I/usr/include/php -I/usr/include/php/main -I/usr/include /php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/ date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/memcache-2.2.5/memcache.c -fP IC -DPIC -o .libs/memcache.o
/usr/local/src/memcache-2.2.5/memcache.c:34:18: error: zlib.h: No such file or d irectory
/usr/local/src/memcache-2.2.5/memcache.c: In function ‘php_memcache_init_globals ‘:
/usr/local/src/memcache-2.2.5/memcache.c:255: error: ‘Z_DEFAULT_COMPRESSION’ und eclared (first use in this function)
/usr/local/src/memcache-2.2.5/memcache.c:255: error: (Each undeclared identifier is reported only once
/usr/local/src/memcache-2.2.5/memcache.c:255: error: for each function it appear s in.)
/usr/local/src/memcache-2.2.5/memcache.c: In function ‘mmc_compress’:
/usr/local/src/memcache-2.2.5/memcache.c:839: error: ‘Z_OK’ undeclared (first us e in this function)
/usr/local/src/memcache-2.2.5/memcache.c:846: error: ‘Z_MEM_ERROR’ undeclared (f irst use in this function)
/usr/local/src/memcache-2.2.5/memcache.c:849: error: ‘Z_BUF_ERROR’ undeclared (f irst use in this function)
/usr/local/src/memcache-2.2.5/memcache.c:852: error: ‘Z_STREAM_ERROR’ undeclared (first use in this function)
/usr/local/src/memcache-2.2.5/memcache.c: In function ‘mmc_uncompress’:
/usr/local/src/memcache-2.2.5/memcache.c:876: error: ‘Z_BUF_ERROR’ undeclared (f irst use in this function)
/usr/local/src/memcache-2.2.5/memcache.c:878: error: ‘Z_OK’ undeclared (first us e in this function)
make: *** [memcache.lo] Error 1
原因在于zlib没有安装,可以用yum install zlib-devel一件安装zlib
安装后就可以继续进行memecache的安装了
转载请注明:江海志の博客 » centos下用kloxo安装memecache出错解决方法