1、获取安装文件包

[root@phpdragon home]# wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
[root@phpdragon home]# wget https://pecl.php.net/get/memcached-2.2.0.tgz

2、安装前编译环境的准备

[root@phpdragon home]# yum install gcc
[root@phpdragon home]# yum install gcc-c++
[root@phpdragon home]# yum install zlib
[root@phpdragon home]# yum install zlib-devel

3、安装libmemcached 

[root@phpdragon home]# tar -zxvf libmemcached-1.0..tar.gz
[root@phpdragon home]# cd libmemcached-1.0.
[root@phpdragon libmemcached-1.0.]# whereis memcached //获取memcached的安装目录
memcached: /usr/local/bin/memcached [root@phpdragon home]# ./configure -prefix=/usr/local/libmemcached -with-memcached=/usr/local/bin/memcached
[root@phpdragon libmemcached-1.0.]# make && make install [root@phpdragon libmemcached-1.0.]# whereis libmemcached //获取libmemcached的安装目录
libmemcached: /usr/local/libmemcached

4、安装php-memcached 

[root@phpdragon home]# tar -zxvf php_memcached-2.2.0.tgz
[root@phpdragon home]# cd memcached-2.2.0/
[root@phpdragon memcached-2.2.0]# phpize //显示没有安装phpize
-bash: phpize: command not found
[root@phpdragon memcached-2.2.0]# yum install php-devel //安装phpize
[root@phpdragon memcached-2.2.0]# phpize
[root@phpdragon memcached-2.2.0]# ./configure --with-php-config=/usr/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl
Installing shared extensions: /usr/lib64/php/modules/

vi /etc/php.d/memcached.ini  保存退出

; ----- Enable memcache extension module
extension=memcached.so ; ----- Options for the memcache module ; Whether to transparently failover to other servers on errors
;memcache.allow_failover=1
; Data will be transferred in chunks of this size
;memcache.chunk_size=32768
; Autocompress large data
;memcache.compress_threshold=20000
; The default TCP port number to use when connecting to the memcached server
;memcache.default_port=11211
; Hash function {crc32, fnv}
;memcache.hash_function=crc32
; Hash strategy {standard, consistent}
;memcache.hash_strategy=consistent
; Defines how many servers to try when setting and getting data.
;memcache.max_failover_attempts=20
; The protocol {ascii, binary} : You need a memcached >= 1.3.0 to use the binary protocol
; The binary protocol results in less traffic and is more efficient
;memcache.protocol=ascii
; Redundancy : When enabled the client sends requests to N servers in parallel
;memcache.redundancy=1
;memcache.session_redundancy=2
; Lock Timeout
;memcache.lock_timeout = 15 ; ----- Options to use the memcache session handler ; Use memcache as a session handler
;session.save_handler=memcache
; Defines a comma separated of server urls to use for session storage
;session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"

重启PHP-fpm

[root@phpdragon home]# service php-fpm start

CentOS-6.4 安装 PHP Memcached 扩展的更多相关文章

  1. CentOS 6.6 安装 PHP Memcached 扩展

    PHP 的 Memcached扩展使用了 libmemcached 库提供的 api 与 memcached 服务端进行交互.它同样提供了一个 session 处理器(memcached). PHP ...

  2. centos 安装php7 memcached扩展

    在使用下面这种方式安装php7 memcached扩展时,先要安装好memcached服务器yum -y install php70w-pecl-memcached

  3. 安装PHP memcached扩展

    引用 pecl.php.net有两个memcache扩展: memcache   memcached extension memcached PHP extension for interfacing ...

  4. linux centos系统 php安装GD库扩展

    yum --enablerepo=remi-php56 install php-gd php-mysql php-mbstring php-xml php-mcrypt //安装GD库扩展 servi ...

  5. Cent OS 6.5安装 php memcached扩展

    首先查看memcache的依赖库是否有安装,如果对这个有疑问可以参考php手册的memcache的安装需求说明 命令如下: 查询: rpm -qa | grep libevent 安装:yum -y ...

  6. centos 6.5 安装php redis 扩展

    一.安装: 其中,添加PHP扩展需要用到 phpize,所以我们需要安装 php-devel 这个包. #yum install php-devel 然后编译安装phpredis: #git clon ...

  7. Centos 下php安装配置xdebug扩展

    2018年05月02日 19:54:42 杨汉松 阅读数:44   1.下载安装xdebug 获取xdebug wget http://www.xdebug.org/files/xdebug-2.3. ...

  8. (转发)centos,redhat 系统为php安装memcached扩展

    转自:http://www.itnose.net/detail/6111623.html 1. 通过yum安装 yum -y install memcached #安装完成后执行: memcached ...

  9. centos系统为php安装memcached扩展

    1. 通过yum安装 yum -y install memcached #安装完成后执行: memcached -h #出现memcached帮助信息说明安装成功 2. 加入启动服务 chkconfi ...

随机推荐

  1. c# 16进制转int

    //十进制转二进制Convert.ToString(69, 2); //69为被转值//十进制转八进制Convert.ToString(69, 8); //69为被转值//十进制转十六进制Conver ...

  2. js 添加天数

    //日期加上天数得到新的日期 //dateTemp 需要参加计算的日期,days要添加的天数,返回新的日期,日期格式:YYYY-MM-DD function getNewDay(dateTemp, d ...

  3. php 扩展包链接

    https://pecl.php.net/package-stats.php?cid=7

  4. 【javascript】js 获取 url 后的参数值

    以前写过一篇类似的博文(提取 url 的搜索字符串中的参数),但是个人觉得使用起来不是很方便,今天抽空重新写了个函数,该函数代码更加简洁. //获取 url 后的参数值 function getUrl ...

  5. USB学习笔记连载(十二):USB描述符

    USB设备是端口,接口,配置的集合,USB协议是以各种USB描述符来表征USB设备的功能.计算机通过这些描述符来获得USB设备的功能. USB描述符包括: USB标准设备描述符,USB集线器描述符.H ...

  6. github开源库(一)

    http://www.open-open.com/lib/view/open1388317199516.html 1.ActionBarSherlock ActionBarSherlock应该算得上是 ...

  7. pymysql和MySQLdb

    MySQLdb创建mysql数据库表 其实mysqldb创建表是有限制的,要求是5.1-5.5版本 pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb几乎相同. 1.下载 首 ...

  8. error: navicat 连接debian系列系统mysql 10038问题解决方案

    还特么有一种可能 阿里云 也有防火墙出口入口规则,这里也有问题

  9. Solr系列六:solr搜索详解优化查询结果(分面搜索、搜索结果高亮、查询建议、折叠展开结果、结果分组、其他搜索特性介绍)

    一.分面搜索 1. 什么是分面搜索? 分面搜索:在搜索结果的基础上进行按指定维度的统计,以展示搜索结果的另一面信息.类似于SQL语句的group by 分面搜索的示例: http://localhos ...

  10. WebService系列一:WebService简介

    原文链接:http://www.cnblogs.com/xdp-gacl/p/4259109.html 一.WebService是什么 WebService是一种跨编程语言和跨操作系统平台的远程调用技 ...