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

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