我安装pecl memcached包遇到了很大的问题。使用任何yum或pear/pecl安装命令都没有成功。我查看了这个问题Install PECL Memcached Error并开始尝试手动配置/编译
我正在使用pecl下载最新版本(memcached-2.2.0),然后解压,运行phpize......
如果我使用--disable-memcached-sasl进行配置,则配置完成,但是make失败。出现了类似语法错误的情况
In file included from /root/memcached-2.2.0/php_memcached_private.h:28,
from /root/memcached-2.2.0/php_memcached.c:26:
/root/memcached-2.2.0/php_libmemcached_compat.h:56: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘php_memcached_instance_st’
/root/memcached-2.2.0/php_memcached.c:328: error: expected declaration specifiers or ‘...’ before ‘php_memcached_instance_st’
/root/memcached-2.2.0/php_memcached.c:329: error: expected declaration specifiers or ‘...’ before ‘php_memcached_instance_st’
/root/memcached-2.2.0/php_memcached.c:330: error: expected declaration specifiers or ‘...’ before ‘php_memcached_instance_st’
/root/memcached-2.2.0/php_memcached.c: In function ‘php_memc_get_impl’:
/root/memcached-2.2.0/php_memcached.c:594: warning: passing argument 4 of ‘memcached_mget_by_key’ from incompatible pointer type
/usr/include/libmemcached/memcached_get.h:38: note: expected ‘char **’ but argument is of type ‘const char **’
/root/memcached-2.2.0/php_memcached.c: In function ‘php_memc_getMulti_impl’:
有更多相关内容,但希望这已经是足够有用的指示了。
如果我使用 --with-libmemcached-dir=/usr/include/libmemcached,我会得到:
checking for libmemcached location... configure: error: Unable to find memcached.h under /usr/include/libmemcached
但那就是 memcached.h 文件所在的地方
如果我使用 --with-libmemcached-dir=no,configure 将会给出
configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
如果我添加了--disable-memcached-sasl选项,它就会配置完成,但是make仍然失败并出现语法错误。
感觉自己陷入了循环。
这不是我第一次从头开始设置服务器使用memcached(虽然我猜已经有一段时间了),我记得以前没有遇到任何问题。
请问有任何想法吗?
这看起来像是一个好的线索
http://blusmurf.net/2012/08/27/pecl-memcache-build-error/
但还是没有成功。
我也从php-memcached的github页面调查了这个问题
https://github.com/php-memcached-dev/php-memcached/issues/69
我现在已经尝试了2.1和2.2,修改文件以尝试使make构建。但仍然没有运气...