在Linux下编译memcache:
memcache官网:http://memcached.org/
前期准备:
如果是虚拟机 保证虚拟机 联网
安装依赖包
yum -y install gcc make libtool autoconf
编译libevent(官网:http://libevent.org/ memcache编译需要用到这个东西)
cd /usr/local/src
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
注意:源码包的地址为https 的 。在虚拟机中可能下载不了 我们只需要在这行命令后面加一个参数
--no-check-certificate 就ok了
tar -zxvf libevent-2.1.8-stable.tar.gz //解压
cd libevent-2.1.8-stable //进入解压目录
./configure --prefix=/usr/local/libevent //编译
make&&make install //安装
编译memcache:
cd /usr/local/src
wget http://www.memcached.org/files/memcached-1.5.12.tar.gz
tar -zxvf memcached-1.5.12.tar.gz
cd memcache-1.5.12
./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent/
make && make install
启动memcache
注意不能以root用户进行启动 要用一个其他的用户 哪个都可以 用参数 -u 设置
让memcache 在后台启动 使用参数 -d表示

linux PHP编译memcache扩展:
php 扩展官网:http://pecl.php.net 搜索memcache 找到php memcache的扩展包

wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar -zxvf memcache-2.2.7.tgz
cd cd memcache-2.2.7

//通过phpize 动态的创建适合本地环境的扩展编译脚本 (configure) 无论装什么扩展都是一样的 安装之前首先要明确phpize php-config两个文件的位置 如果不知道 可以通过 find / -name 'phpize' find / -name 'php-config' 命令来进行查找

/phpstudy/server/php/bin/phpize --with-php-config=/phpstudy/server/php/bin/php-config
./configure --with-php-config=/phpstudy/server/php/bin/php-config
make && make install
//安装成功之后 会出现 类似如下字样的路径:将此路径进行拷贝 然后查看此路径下面有没有 .so的扩展文件

//验证是否生成扩展文件 memcache.so
ls /phpstudy/server/php/lib/php/extensions/no-debug-non-zts-20121212/
//修改php.ini
添加:
extension=/phpstudy/server/php/lib/php/extensions/no-debug-non-zts-20121212/memcache.so

虚拟机环境 安装 php7memcache扩展:
wget https://github.com/websupport-sk/pecl-memcache/archive/php7.zip
unzip pecl-memcache-php7.zip
cd pecl-memcache-php7
/usr/local/php/bin/phpize --with-php-config=/usr/local/php/bin/php-config
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
修改php.ini

linux 编译PHP memcache扩展的更多相关文章

  1. linux php 安装 memcache 扩展

    1. memcached依赖于libevent,需要先安装libevent. tar zxvf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-sta ...

  2. Linux 编译安装 php 扩展包 curl

    php源码目录:/root/php php编译目录:/usr/local/webserver/php/ curl源码目录:/root/curl 1.curl,主要用于发送http请求,是php的一个扩 ...

  3. linux编译php gd扩展

    1 安装gd的依赖包 yum -y install gd gd2 gd-devel gd2-devel zlib freetype 2 安装jpeg: wget http://www.ijg.org/ ...

  4. lamp环境编译安装curl扩展

    Linux编译安装php扩展包curl 1.curl,主要用于发送http请求,是php的一个扩展包. 2.安装过程: (1)curl下载:http://curl.haxx.se/download.h ...

  5. linux上安装php7 memcache扩展 和 安装服务端memcached

    linux上安装memcached不算太困难.唯一让本人感到困难的是 php7的memcache扩展安装.真的蛋疼! 先说安装服务端 memcached 1. 首先安装Libevent事件触发管理器. ...

  6. linux下安装PHP扩展memcache

    公司的服务器 CentOS 7.5,PHP 5.6 下面都是最新的版本(支持到PHP5.6) 如需php7  下支持memcache扩展,请移步   https://www.cnblogs.com/h ...

  7. Centos7 编译安装 Nginx PHP Mariadb Memcache扩展 ZendOpcache扩展 (实测 笔记 Centos 7.0 + Mariadb 10.1.9 + Nginx 1.9.9 + PHP 5.5.30)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1503-01.iso 安装步骤: 1.准备 1.1 ...

  8. linux下给php安装memcached及memcache扩展(转)

    http://kimi.it/257.html (另外的方法)linux安装memcached及memcache扩展一.安装libevent函数库下载地址:http://libevent.org默认被 ...

  9. linux安装memcached及memcache扩展

    一.安装libevent函数库 下载地址:http://libevent.org 默认被安装到:/usr/local/lib目录下 安装memcached之前需要先安装libevent函数库. 可以通 ...

随机推荐

  1. jquery.cookie 介绍 和 用法

    1.依赖jQuery库 2.浏览器兼容性情况 3.下载 官方github:https://github.com/carhartl/jquery-cookie 4.使用 创建一个整站cookie $.c ...

  2. 购买阿里云的云服务器时选择镜像centos时应该选择哪个版本

    购买阿里云的云服务器时选择镜像centos时应该选择哪个版本 方法/步骤首先,我们要清楚的便是每个系统之间的差别,以及在阿里云上的差别:1. Windows1.1) 系统内含正版激活.1.2) 适合于 ...

  3. jquery怎么根据后台传过来的值动态设置下拉框、单选框选中

    $(function(){ var sex=$("#sex").val(); var marriageStatus=$("#marriageStatus").v ...

  4. 8.3 mysql 表操作

    库操作 一 系统数据库 information_schema: 虚拟库,不占用磁盘空间,存储的是数据库启动后的一些参数,如用户表信息.列信息.权限信息.字符信息等    performance_sch ...

  5. CI框架入门教程

    1. URL常用的相关函数 url相关函数在辅助类url中第一,要使用它们必须先加载$this->load->helper('url')或者自动装载    site_url('控制器/方法 ...

  6. TCP的几个状态(SYN/FIN/ACK/PSH/RST)

    在TCP层,有个FLAGS字段,这个字段有以下几个标识:SYN, FIN, ACK, PSH, RST, URG. 其中,对于我们日常的分析有用的就是前面的五个字段. 含义: SYN 表示建立连接, ...

  7. SOCK开发之---TCP/IP简介

    在开发通信程序之前,都要先确定这些程序相互通信所使用的协议(protocol),在深入设计前,我们都需要先从高层次来判断通信由哪个程序发起以及相应在何时产生. 举例来说,一般认为web服务器是一个长时 ...

  8. selenium 元素可以定位到,但是无法点击问题

    报错1: selenium.common.exceptions.WebDriverException: Message: Element is not clickable at point (82, ...

  9. LR中的迭代次数设置

    在参数化时,对于一次压力测试中均只能用一次的资源应该怎么参数化呢?就是说这些资源用了一次就不能在用了的. --参数化时,在select  next row选择unique,update value o ...

  10. centos 下wps 与goland 不能输入中文的解决办法

    输入法:CentOS7自带ibus,如果你用的是fcitx请在对应的地方进行修改 系统:CentOS7,这个方案应该适用于大多数Linux发行版本 intelliJ goland中文输入法问题解决 首 ...