linux memcached安装
2018-06-22 04:53:07来源:未知 阅读 ()
准备安装包:
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.localdomain 2.6.32-573.el6.i686 #1 SMP Thu Jul 23 12:37:35 UTC 2015 i686 INI actual : /usr/local/src/memcache-2.2.7/tmp-php.ini More .INIs : CWD : /usr/local/src/memcache-2.2.7 Extra dirs : VALGRIND : Not used ===================================================================== TIME START 2016-07-15 13:12:21 ===================================================================== No tests were run. [root@localhost memcache-2.2.7]# make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
6、配置php.ini
extension=memcached.so
extension=memcache.so
7、重启服务器
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:php定时任务
- win7搭建Linux+PHP 开发环境 2020-03-01
- 使用Linux的经验技巧 2020-02-13
- php安装扩展mysqli的实现步骤及报错解决办法 2020-01-16
- PHP环境中Memcache的安装和使用 2019-12-11
- linux环境之apache多端口配置虚拟主机的操作方法 2019-10-25
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash