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. 【LeetCode】Permutations 解题报告

    全排列问题.经常使用的排列生成算法有序数法.字典序法.换位法(Johnson(Johnson-Trotter).轮转法以及Shift cursor cursor* (Gao & Wang)法. ...

  2. 【jquery】jquery 在 ie6 下无法设置 select 选中的解决方法

    本文主要解决在 ie6 下,jquery 无法设置 select 选中的问题.我们先看个例子: <!DOCTYPE HTML> <html lang="en-US" ...

  3. 【转】VMware Fusion Professional 10 序列号

    http://bbs.feng.com/forum.php?mod=viewthread&tid=11456176

  4. mac配置--ant

    每次在新的电脑安装开发工具总是免不了下载各种软件和配置环境,本文针对mac下安装ant小结一下. 安装ant的方法很多,最直接的可以到apache-ant官网http://ant.apache.org ...

  5. Python模拟Linux的Crontab, 写个任务计划需求

    Python模拟Linux的Crontab, 写个任务计划需求 来具体点 需求: 执行一个程序, 程序一直是运行状态, 这里假设是一个函数 当程序运行30s的时候, 需要终止程序, 可以用python ...

  6. Java如何使用catch来处理异常?

    在Java编程中,如何使用catch块来处理异常? 此示例显示如何使用catch来处理异常. package com.yiibai; public class UseOfCatch { public ...

  7. e786. 创建JSpinner组件

    This example demonstrates how to build three kinds of spinners. A number spinner: // Create a number ...

  8. python获取代码行号

    获取行号: def get_file(): print("文件名 :",__file__,sys._getframe().f_lineno) print("函数名: &q ...

  9. Linux基础网络设置

    查看Linux网络参数 ifconfig—-查看网络接口 > [root@localhost ~]# ifconfig eth1 Link encap:Ethernet HWaddr 00:0C ...

  10. 【转】C# 异常处理 throw和throw ex的区别 try catch finally的执行顺序(return)

    [转]throw和throw ex的区别 之前,在使用异常捕获语句try...catch...throw语句时,一直没太留意几种用法的区别,前几天调试程序时无意中了解到几种使用方法是有区别的,网上一查 ...