您好,登錄后才能下訂單哦!
安裝所要軟件
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
wget http://pecl.php.net/get/memcached-1.0.2.tgz
memcached的官方網(wǎng)站 http://www.memcached.org/
安裝libmemcached
tar zxvf libmemcached-0.42.tar.gz
cd libmemcached-0.42
./configure –-prefix=/usr/local/libmemcached –-with-memcached
make && make install
安裝要注意的問(wèn)題:
1, 安裝過(guò)程中不要忘了,–with-memcached,不然會(huì)提示你
checking for memcached… no
configure: error: “could not find memcached binary”
2,你的memcached是不是1.2.4以上的,如果不是會(huì)提示你
clients/ms_thread.o: In function `ms_setup_thread’:
/home/zhangy/libmemcached-0.42/clients/ms_thread.c:225: undefined reference to `__sync_fetch_and_add_4′
clients/ms_thread.o:/home/zhangy/libmemcached-0.42/clients/ms_thread.c:196: more undefined references to `__sync_fetch_and_add_4′ follow
collect2: ld returned 1 exit status
make[2]: *** [clients/memslap] Error 1
make[2]: Leaving directory `/home/zhangy/libmemcached-0.42′
解決辦法是–disable-64bit CFLAGS=”-O3 -march=i686″,
最好的方法是換個(gè)版本的軟件
https://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz
./configure --prefix=/usr/local/libmemcached --with-memcached
如果不用這個(gè)64位的long型數(shù)據(jù),我想php擴(kuò)展memcached,memcache也就沒(méi)什么區(qū)別了,裝memcached也就沒(méi)什么意思了。
php的擴(kuò)展memcached的安裝
tar zxvf memcached-1.0.2.tar.gz
cd memcached-1.0.2
/usr/local/php/bin/phpize
./configure --with-memcached -with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --enable-memcached
make && make install
vi /usr/local/php/lib/php.ini
加上extension=memcached.so重起一下服務(wù)就可以了。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。