linux 编辑memcahed以及memcahed+php扩展遇到的问题

安装memcached


安装步骤:

memcached 依赖于libevent 库,因此我们需要先安装libevent.
分别到libevent.org 和memcached.org 下载最新的stable 版本(稳定版).
先编译libevent ,再编译memcached,
编译memcached 时要指定libevent 的路径.
过程如下: 假设源码在/usr/local/src 下, 安装在/usr/local 下
# tar zxvf libevent-2.0.21-stable.tar.gz
# cd libevent-2.0.21-stable
# ./configure --prefix=/usr/local/libevent
# 如果出错,读报错信息,查看原因,一般是缺少库
# make && make install
# tar zxvf memcached-1.4.5.tag.gz
# cd memcached-1.4.5
#./configure--prefix=/usr/local/memcached \
--with-libevent=/usr/local/libeventling
# make && make install

错误1:make的时候,无限编译,多半是linux时间有问题

解决方法:输入命令:date -s  时间

                                        clock -w

错误2:报错事例:

items.c: In function ‘crawler_crawl_q’:
items.c:1141: 警告:由于数据类型范围限制,比较结果永远为真
make[2]: *** [memcached_debug-items.o] 错误 1
make[2]: Leaving directory `/tmp/memcached-1.4.24'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/tmp/memcached-1.4.24'
make: *** [all] 错误 2
解决办法:在memcached的编译目录下找到 Makefile 文件,搜索到 -Werror 去掉:原因是:-wall 与Werror(遇到警告停止编译)
安装memcached + php扩展
提示安装:/libmemcached
最后的配置:
.configue --prefix=/usr/local/libmemcached  --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/lcoal/libmemcached

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章