Memcached是一个高性能的分布式内存对象缓存系统,用于动态web应用以减轻数据库的负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提拱动态 数据驱动网站的速度。

memcached是其于libevent做事件触发的,首先装libevent.

wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
[root@14LN src]# tar -xzvf libevent-2.0.21-stable.tar.gz
[root@14LN libevent-2.0.21-stable]# pwd
/usr/local/src/libevent-2.0.21-stable
[root@14LN libevent-2.0.21-stable]# ./configure --prefix=/usr/local/libevent
[root@14LN libevent-2.0.21-stable]# make && make install
[root@14LN libevent-2.0.21-stable]# ls -al /app/server/libevent/lib/ |grep libevent
lrwxrwxrwx. 1 root root 21 Jul 12 20:36 libevent-2.0.so.5 -> libevent-2.0.so.5.1.9
-rwxr-xr-x. 1 root root 968450 Jul 12 20:36 libevent-2.0.so.5.1.9
-rw-r--r--. 1 root root 1571290 Jul 12 20:36 libevent.a
lrwxrwxrwx. 1 root root 26 Jul 12 20:36 libevent_core-2.0.so.5 -> libevent_core-2.0.so.5.1.9
-rwxr-xr-x. 1 root root 585065 Jul 12 20:36 libevent_core-2.0.so.5.1.9
-rw-r--r--. 1 root root 978042 Jul 12 20:36 libevent_core.a
-rwxr-xr-x. 1 root root 986 Jul 12 20:36 libevent_core.la
lrwxrwxrwx. 1 root root 26 Jul 12 20:36 libevent_core.so -> libevent_core-2.0.so.5.1.9
lrwxrwxrwx. 1 root root 27 Jul 12 20:36 libevent_extra-2.0.so.5 -> libevent_extra-2.0.so.5.1.9
-rwxr-xr-x. 1 root root 404772 Jul 12 20:36 libevent_extra-2.0.so.5.1.9
-rw-r--r--. 1 root root 593320 Jul 12 20:36 libevent_extra.a
-rwxr-xr-x. 1 root root 993 Jul 12 20:36 libevent_extra.la
lrwxrwxrwx. 1 root root 27 Jul 12 20:36 libevent_extra.so -> libevent_extra-2.0.so.5.1.9
-rwxr-xr-x. 1 root root 951 Jul 12 20:36 libevent.la
lrwxrwxrwx. 1 root root 30 Jul 12 20:36 libevent_pthreads-2.0.so.5 -> libevent_pthreads-2.0.so.5.1.9
-rwxr-xr-x. 1 root root 18470 Jul 12 20:36 libevent_pthreads-2.0.so.5.1.9
-rw-r--r--. 1 root root 18710 Jul 12 20:36 libevent_pthreads.a
-rwxr-xr-x. 1 root root 1014 Jul 12 20:36 libevent_pthreads.la
lrwxrwxrwx. 1 root root 30 Jul 12 20:36 libevent_pthreads.so -> libevent_pthreads-2.0.so.5.1.9
lrwxrwxrwx. 1 root root 21 Jul 12 20:36 libevent.so -> libevent-2.0.so.5.1.9
[root@14LN libevent-2.0.21-stable]#

接下来安装Memcached:

[root@14LN src]# wget http://pkgs.fedoraproject.org/lookaside/pkgs/memcached/memcached-1.4.15.tar.gz/36ea966f5a29655be1746bf4949f7f69/memcached-1.4.15.tar.gz
[root@14LN src]# tar -xzvf memcached-1.4.15.tar.gz
[root@14LN src]# cd memcached-1.4.15
[root@14LN memcached-1.4.15]# ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent
[root@14LN memcached-1.4.15]# make && make install
安装php扩展模块memcache
[root@14LN src]# wget http://pecl.php.net/get/memcache-2.2.6.tgz
[root@14LN src]# cd memcache-2.2.6
[root@14LN memcache-2.2.6]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
[root@14LN memcache-2.2.6]# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
[root@14LN memcache-2.2.6]# make && make install 安装成功会有类似下面的提示:
Build complete.
Don't forget to run 'make test'. Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/ [root@14LN memcache-2.2.6]# egrep 'memcache|extension_dir' /etc/php.ini
[memcache]
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/"
extension=memcache.so
; extension_dir = "./"
; extension_dir = "ext"
; Be sure to appropriately set the extension_dir directive.
;sqlite3.extension_dir =
启动memcache
[root@14LN memcache-2.2.6]# /usr/local/memcached/bin/memcached -d -u root -m 63 -p 11211 -c 10240
[root@14LN memcache-2.2.6]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm done

安装memcached服务器和PHP中添加memcache拓展模块的更多相关文章

  1. windows下安装Memcached服务器,PHP的memcache扩展

    Memcahed 介绍:Memcahed是一个内存缓存服务器 (类似MySQL服务器) 作用:提高web的响应速度,例如缓存数据库查询结果 原理:把数据存到内存中 (提高速度的原因) 教程相关 系统: ...

  2. 源码安装Memcached服务器及其2种PHP客户端

    本文所用源码包皆为当时最新stable稳定版. 安装memcached服务器 先安装libevent, 最新版为2.0.21 tar -zxvf libevent-2.0.21-stable.tar. ...

  3. Android中添加自己的模块 【转】

    本文转载自:http://wallage.blog.163.com/blog/static/17389624201021791333695/ 转:http://blog.csdn.net/yili_x ...

  4. 在jekyll模板博客中添加网易云模块

    最近使用GitHub Pages + Jekyll 搭建了个人博客,作为一名重度音乐患者,博客里面可以不配图,但是不能不配音乐啊. 遂在博客里面引入了网易云模块,这里要感谢网易云的分享机制,对开发者非 ...

  5. idea中添加多级父子模块

    在 IntelliJ IDEA 中,没有类似于 Eclipse 工作空间(Workspace)的概念,而是提出了Project和Module这两个概念. 在 IntelliJ IDEA 中Projec ...

  6. VS2010安装项目的系统必备中添加.NET 2.0

    把DotNetFX.rar解压后的DotNetFX文件夹,放置于安装了 VS2010 的 C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrap ...

  7. ZYNQ原理图中添加RTL设计模块

    前言 已有的RTL模块怎么添加到原理图中? 流程 (1)添加文件到设计中. (2)右键文件添加到block design中. (3)连线即可. 以上.

  8. 如何在Pycharm中添加新的模块

    在使用Pycharm编写程序时,我们时常需要调用某些模块,但有些模块事先是没有的,我们需要把模块添加上去. 最近在学习爬虫,写了下面几行代码: 结果出现错误 错误ModuleNotFoundError ...

  9. 如何在html中添加引用公共模块文件

    1.首先需要修改apache的配置文件: 打开httpd.conf 搜索“AddType text/html .shtml” 搜索结果: AddType text/html .shtml .html ...

随机推荐

  1. LocalDB简介和在VS2012及以上版本的使用

    http://www.cnblogs.com/fzrain/p/3812364.html?utm_source=tuicool LocalDB简介和在VS2012及以上版本的使用   之前一不小心把自 ...

  2. MongoDB之bson的介绍

    MongoDB之bson的介绍 1. 什么是bson BSON是一种类json的一种二进制形式的存储格式,简称Binary JSON,它和JSON一样,支持内嵌的文档对象和数组对象,但是BSON有JS ...

  3. Deep Learning in a Nutshell: Core Concepts

    Deep Learning in a Nutshell: Core Concepts This post is the first in a series I’ll be writing for Pa ...

  4. --hdu 1050 Moving Tables(贪心)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1050 AC code: #include<stdio.h> #include<str ...

  5. Jenkins 搭建U3D自动发布 IOS

    http://www.cnblogs.com/yinghuochong/archive/2013/09/01/3294940.html 1.安装包,工具略过. 2.插件管理 Subversion Pl ...

  6. Java读取word文档,转换为网页

    public class Test3 { /** * * @param path * @param paths * @param savepaths */ public static void cha ...

  7. android源代码提示文本框还能输入多少个字符

    public class TestAndroidActivity extends Activity { /** Called when the activity is first created. * ...

  8. 新浪微博客户端(23)-计算Cell内控件的frame

    DJStatusCellFrame.m #import "DJStatusCellFrame.h" #import "DJStatus.h" #import & ...

  9. C++ 的语言杂谈(一)--C++不是新手友好的

    C++的语言品味是独特的,喜欢的人特别喜欢,讨厌的人特别讨厌.虽然Bjane Stroustrup不断地宣称C++的发展方向是新手友好的,但实际上对新手来说,最重要的还是有强大方便的标准库可以使用(像 ...

  10. 转 Xenserver HVM is required for this operation的解决办法

    今天在XenServer中安装虚拟机时出现如下错误: 原因:没有开启XenServer服务器主机的虚拟化支持功能 解决办法:在XenServer主机的BIOS里开启CPU的虚拟化支持功能 本文出自 “ ...