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(由於系統自帶的版本舊,忽略依賴刪除)

2. 安裝libevent命令: (https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz)
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))

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM