标签:
Memecached 服务器安装(一)
前提:首先您的php环境已经安装完成,如若没有则参考
http://www.cnblogs.com/xulele/p/5264781.html
安装环境链接:http://pan.baidu.com/s/1i4IbJox
1,安装libmemcached
tar zxvf libmemcached-0.42.tar.gz
cd libmemcached-0.42
./configure --prefix=/usr/local/libmemcached? --with-memcached
make && make install
安装要注意的问题:
1,? 安装过程中不要忘了,--with-memcached,不然会提示你
checking for memcached... no
configure: error: "could not find memcached binary"
2,你的memcached是不是1.2.4以上的,如果不是会提示你
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",如果不用这个64位的long型数据,我想php扩展memcached,memcache也就没什么区别了,装memcached也就没什么意思了。
五,php的扩展memcached的安装
?
tar zxvf memcached-1.0.2.tar.gz
cd memcached-1.0.2
/usr/local/php/bin/phpize
./configure --enable-memcached --with-php-config=/usr/local/php5.6/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --prefix=/usr/local/phpmemcached
make && make install
vi /usr/local/php/lib/php.ini
加上extension=memcached.so重起一下服务就可以了。
?
Memcached 插件地址
/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
?
修改Php.ini
Cd /etc
Vim php.ini
加入:
extension=/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/memcached.so
标签:
原文地址:http://www.cnblogs.com/xulele/p/5324937.html