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. linux 获取网卡信息

    sar -n DEV 2 10:41:37 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s10:41:39 AM eth ...

  2. LibGDX skins

    https://github.com/czyzby/gdx-skins ———————————————————————————————————————————— LibGDX comes with a ...

  3. php 二维数组打乱顺序

    public function shuffle_assoc($list) { if (!is_array($list)) return $list; $keys = array_keys($list) ...

  4. Java零拷贝

    1.摘要 零拷贝的“零”是指用户态和内核态间copy数据的次数为零. 传统的数据copy(文件到文件.client到server等)涉及到四次用户态内核态切换.四次copy.四次copy中,两次在用户 ...

  5. [zookeeper] Zookeeper伪分布式集群配置

    参考配置:http://blog.csdn.net/clementad/article/details/48057059 注意要点: 启动时注意分别启动 bin/zkServer.sh start c ...

  6. python一天一题(2)

    python查询mysql数据库 import pymysql host = '192.168.74.5' user = 'root' passwd ='root' port = 3310 db = ...

  7. (笔记)Linux下查看CPU使用率的命令

    1.top 使用权限:所有使用者 使用方式:top [-] [d delay] [q] [c] [S] [s] [i] [n] [b] 说明:即时显示process的动态 d :改变显示的更新速度,或 ...

  8. Spring JDBC对象批量操作

    以下示例将演示如何使用spring jdbc中的对象进行批量更新.我们将在单次批次操作中更新student表中的记录. student表的结果如下 - CREATE TABLE student( id ...

  9. 工作所用的日常 Git 命令

    几乎每个开发人员都在使用 Git,当然很可能是 GitHub.但大多数开发者大概有 99% 的时间只是使用这三个命令: #使用命令git add <file>,将文件添加到暂存区 git ...

  10. 10.11 Linux网络相关 10.12 firewalld和netfilter 10.13 netfilter5表5链介绍 10.14 iptables语法

    Linux网络相关 ifocnfig 查看网卡ip(yum install net-tools) ip add 查看网卡 ip add = ifocnfig ifconfig 不显示down掉的网卡, ...