TOP

linux memcached安装(一)
2017-10-10 11:37:02 】 浏览:10061
Tags:linux memcached 安装

准备安装包:

libevent-2.0.21-stable.tar.gz  //Memcached服务端的依赖包

memcached-1.4.29.tar.gz   //Memcached服务端

libmemcached-1.0.18.tar.gz  //Memcached扩展的依赖包

memcached-2.2.0.tgz  //php的Memcached扩展

memcache-2.2.7.tgz  //php的Memcache扩展

1、安装libevent

[root@localhost src]# tar -zxvf libevent-2.0.21-stable.tar.gz
[root@localhost src]# cd libevent-2.0.21-stable
[root@localhost libevent-2.0.21-stable]# ./configure --prefix=/usr/local/libevent
[root@localhost libevent-2.0.21-stable]# make
[root@localhost libevent-2.0.21-stable]# make install

2、安装Memcached服务端

[root@localhost src]# tar -zxvf memcached-1.4.29.tar.gz 
[root@localhost src]# cd memcached-1.4.29
[root@localhost memcached-1.4.29]# ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent

[root@localhost memcached-1.4.29]# make
[root@localhost memcached-1.4.29]# make install

3、启动Memcached服务

[root@localhost /] /usr/local/memcached/bin/memcached -d -m 256 -u root -p 11211 -c 1024 -P /tmp/memcached.pid

-d选项是启动一个守护进程,
-m是分配给Memcache使用的内存数量,单位是MB.
-u是运行Memcache的用户.
-l是监听的服务器IP地址,我这里没有填.
-p是设置Memcache监听的端口.
-c选项是最大运行的并发连接数,默认是1024,按照你服务器的负载量来设定.
-P是设置保存Memcache的pid文件.

4、安装Memcached扩展的依赖包

[root@localhost src]# tar -zxvf libmemcached-1.0.18.tar.gz
[root@localhost src]# cd libmemcached-1.0.18
[root@localhost libmemcached-1.0.18]# ./configure --prefix=/usr/local/libmemcached --with-memcached=/usr/local/memcached/bin/memcached
[root@localhost libmemcached-1.0.18]# make

make的时候出现:./libtool: line 1125: g++: command not found 错误

[root@localhost /]# yum -y install gcc+ gcc-c++

然后重新安装

[root@localhost libmemcached-1.0.18]# ./configure --prefix=/usr/local/libmemcached --with-memcached=/usr/local/memcached/bin/memcached
[root@localhost libmemcached-1.0.18]# make
[root@localhost libmemcached-1.0.18]# make install

5、安装Memcached PHP扩展

[root@localhost src]# tar -zxvf memcached-2.2.0.tgz 
[root@localhost src]# cd memcached-2.2.0
[root@localhost memcached-2.2.0]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
[root@localhost memcached-2.2.0]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
...
...
---------------------------------------------------------------------- Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/

安装Memcache PHP扩展

[root@localhost src]# tar -zxvf memcache-2.2.7.tgz 
[root@localhost src]# cd memcache-2.2.7[root@localhost memcache-2.2.7]# /usr/local/php/bin/phpize 
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
[root@localhost memcache-2.2.7]# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
[root@localhost memcache-2.2.7]# make
[root@localhost memcache-2.2.7]# make test

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /usr/local/php/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 5.5.36
ZEND_VERSION: 2.5.0
PHP_OS      : Linux - Linux localhost  
		
linux memcached安装(一) https://www.cppentry.com/bencandy.php?fid=85&id=129275

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇PHPExcel说明 下一篇sphinx,coreseek安装