make: [php_memcached.lo],Memcached遇到的问题及解决办法

memcached make: *** No targets specified and no makefile found. Stop.

其实是因为在安装libevent时增加了版本号导致的,所以注意在安装libevent时不要增加版本号

1.rpm -qa|grep libevent

查看系统是否带有该安装软件,如果有执行命令:

rpm -e libevent-1.4.13-4.el6.i686 –nodeps(由于系统自带的版本旧,忽略依赖删除)

tar zxvf libevent-2.0.21-stable.tar.gz

cd libevent-2.0.21-stable

./configure –prefix=/usr

make

make install

至此libevent安装完毕

在 php-memcached官网发现有最新的版本3.0.3 stable版本,安装几次没有成功,总提示

/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4361: error: too few arguments to function ‘zend_declare_class_constant_bool’/bby_install/install-pack/memcached-3.0.1/php_memcached.c: In function ‘zm_startup_memcached’:/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4371: error: ‘zend_object_handlers’ has no member named ‘offset’/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4373: error: ‘zend_object_handlers’ has no member named ‘free_obj’/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4378: error: too few arguments to function ‘zend_register_internal_class’/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4378: warning: assignment from incompatible pointer type/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4379: warning: assignment from incompatible pointer type/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4393: error: too few arguments to function ‘zend_register_internal_class_ex’/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4393: warning: assignment from incompatible pointer type/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4379: warning: assignment from incompatible pointer type/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4393: error: too few arguments to function ‘zend_register_internal_class_ex’/bby_install/install-pack/memcached-3.0.1/php_memcached.c:4393: warning: assignment from incompatible pointer typemake: *** [php_memcached.lo] Error 1……

php的扩展memcache,不支持cas,所以我们要装memcached扩展,memcached扩展是基于libmemcached,所以要先安装libmemcached

wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

tar zxvf libmemcached-1.0.18.tar.gz cd libmemcached-1.0.18

./configure --prefix=/usr/local/libmemcached --with-memcached make make install

checking for libevent directory… configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/

If it’s already installed, specify its path using –with-libevent=/dir/

提示需要libevent,需要指明libevent的安装目录

memcached 依赖于 libevent 库,因此我们需要先安装 libevent.,ibevent和memcached的下载路径

http://sourceforge.net/projects/levent/?source=typ_redirect

[root@localhost upload]#tar zxvf libevent-2.0.21-stable.tar.gz

[root@localhost upload]# cd libevent-2.0.22-stable

[root@localhost upload]#./configure –prefix=/usr/local/libevent

[root@localhost upload]#make && make install

[root@localhost upload]#   ./configure –prefix=/usr/local/memcached –with-libevent=/usr/local/libevent

make: *** [memcache.lo] Error 1:

vi memcache.c

将所有的:zend_list_insert(pool, le_memcache_pool);

改为:zend_list_insert(pool, le_memcache_pool TSRMLS_CC);

将所有的:zend_list_insert(mmc, le_pmemcache);

改为:zend_list_insert(mmc, le_pmemcache TSRMLS_CC);

将所有的:if (!zend_is_callable(failure_callback, 0, NULL))

改为:if (!zend_is_callable(failure_callback, 0, NULL, NULL))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值