libmemcache 1.0.11 & 1.0.12 have problem !

我在 CentOS 5.8 x86_64 上面將 php 5.2 升級到 5.3 去
先升級 memcache 到 1.4.15, libmemcached 到 1.0.12(原本是 0.x)
php 5.3 要用 pecl 安裝 memcached 會出現下面問題


# /usr/local/php5/bin/pecl install memcached
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading memcached-2.1.0.tgz ...
Starting to download memcached-2.1.0.tgz (39,095 bytes)
..........done: 39,095 bytes
11 source files, building
WARNING: php_bin /usr/local/php5/bin/php appears to have a suffix 5/bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
building in /tmp/pear/temp/pear-build-rootSXEpVq/memcached-2.1.0
running: /tmp/pear/temp/memcached/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for icc... no
checking for suncc... no
checking whether /usr/bin/gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php5
checking for PHP includes... -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /usr/local/php5/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable memcached support... yes, shared
checking for libmemcached... yes, shared
checking whether to enable memcached session handler support... yes
checking whether to enable memcached igbinary serializer support... no
checking whether to enable memcached json serializer support... no
checking whether to disable memcached sasl support... no
checking for ZLIB... yes, shared
checking for zlib location... /usr
checking for session includes... /usr/local/php5/include/php
checking for memcached session support... enabled
checking for memcached igbinary support... disabled
checking for libmemcached location... /usr/local
checking for ld used by /usr/bin/gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from /usr/bin/gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if /usr/bin/gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc option to produce PIC... -fPIC
checking if /usr/bin/gcc PIC flag -fPIC works... yes
checking if /usr/bin/gcc static flag -static works... yes
checking if /usr/bin/gcc supports -c -o file.o... yes
checking whether the /usr/bin/gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
checking whether the /usr/bin/g++44 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for /usr/bin/g++44 option to produce PIC...
checking if /usr/bin/g++44 static flag  works... yes
checking if /usr/bin/g++44 supports -c -o file.o... yes
checking whether the /usr/bin/g++44 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... unsupported
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-rootSXEpVq/memcached-2.1.0/libtool --mode=compile /usr/bin/gcc -I/usr/local/php5/include/php  -I. -I/tmp/pear/temp/memcached -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootSXEpVq/memcached-2.1.0/include -I/tmp/pear/temp/pear-build-rootSXEpVq/memcached-2.1.0/main -I/tmp/pear/temp/memcached -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/memcached/php_memcached.c -o php_memcached.lo
mkdir .libs
 /usr/bin/gcc -I/usr/local/php5/include/php -I. -I/tmp/pear/temp/memcached -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootSXEpVq/memcached-2.1.0/include -I/tmp/pear/temp/pear-build-rootSXEpVq/memcached-2.1.0/main -I/tmp/pear/temp/memcached -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/memcached/php_memcached.c  -fPIC -DPIC -o .libs/php_memcached.o
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_get_impl’:
/tmp/pear/temp/memcached/php_memcached.c:599: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_getMulti_impl’:
/tmp/pear/temp/memcached/php_memcached.c:797: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:800: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_fetch’:
/tmp/pear/temp/memcached/php_memcached.c:1014: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:1017: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_fetchAll’:
/tmp/pear/temp/memcached/php_memcached.c:1068: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:1071: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:1121:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c: In function ‘zim_Memcached_getServerByKey’:
/tmp/pear/temp/memcached/php_memcached.c:1977: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:2178:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:2235:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:2246:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:2275:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_set_option’:
/tmp/pear/temp/memcached/php_memcached.c:2280: error: ‘memcached_st’ has no member named ‘hash’
/tmp/pear/temp/memcached/php_memcached.c:2321:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_do_serverlist_callback’:
/tmp/pear/temp/memcached/php_memcached.c:2583: warning: passing argument 4 of ‘add_assoc_string_ex’ discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:2677:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_handle_error’:
/tmp/pear/temp/memcached/php_memcached.c:2680: error: ‘memcached_st’ has no member named ‘cached_errno’
/tmp/pear/temp/memcached/php_memcached.c:2688:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:2691: error: ‘memcached_st’ has no member named ‘cached_errno’
/tmp/pear/temp/memcached/php_memcached.c: In function ‘php_memc_do_result_callback’:
/tmp/pear/temp/memcached/php_memcached.c:3191: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:3194: warning: assignment discards qualifiers from pointer target type
/tmp/pear/temp/memcached/php_memcached.c:3522:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:3680:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:3705:42: error: token "@" is not valid in preprocessor expressions
/tmp/pear/temp/memcached/php_memcached.c:3709:42: error: token "@" is not valid in preprocessor expressions
make: *** [php_memcached.lo] Error 1
ERROR: `make' failed


上網查了一下有這問題的人不多
因為之前有先測試過升級到 php 5.3 都沒問題
於是想說從 libmemcached 下手看看
果真是新的版本問題

提供安裝步驟供參考:

安裝 memcached
# wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
# ./configure
# make && make install

啟動 memcached
/usr/local/bin/memcached -d -u root -m 128 -p 11211

安裝 libmemcached
# http://download.tangent.org/libmemcached-1.0.10.tar.gz
#./configure --with-memcached
# make && make install

php 5.3 安裝
./configure --prefix=/usr/local/php5 \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-config-file-path=/usr/local/php5 \
--enable-mbstring --enable-ftp --with-zlib --with-regex=php \
--with-xmlrpc \
--with-gd --enable-gd-native-ttf \
--enable-exif \
--with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib \
--with-freetype-dir=/usr/lib \
--with-xpm-dir=/usr/lib \
--with-gettext \
--enable-soap \
--with-pdo-mysql=/usr/local/mysql \
--with-mhash \
--with-mcrypt \
--with-openssl \
--with-curl \
--enable-sockets \

安裝 pecl 的 memcached 套件
/usr/local/php5/bin/pecl install memcached
記得要在 php.ini 加上檔案的位置

Comments

Popular posts from this blog

CentOS7 如何新增/移除 Rich Rule for firewalld

mac 安裝 mtr

如何設定 SSL VPN 分割通道 on Fortigate 80C