在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. 32-python代码打包成exe文件-pyinstaller

    安装 pyinstaller: pip install pyinstall 简单使用 最简单的使用方式是运行 pyinstaller myscript.py 来生成可执行文件,其中 myscript. ...

  2. mysql添加表注释、字段注释、查看与修改注释

    1 创建表的时候写注释create table test1( field_name int comment '字段的注释')comment='表的注释'; 2 修改表的注释alter table te ...

  3. jquery破坏链

  4. 递归,回溯和DFS的区别

    递归是一种算法结构,回溯是一种算法思想一个递归就是在函数中调用函数本身来解决问题回溯就是通过不同的尝试来生成问题的解,有点类似于穷举,但是和穷举不同的是回溯会“剪枝”,意思就是对已经知道错误的结果没必 ...

  5. 怎样将word中的图片插入到CSDN博客中

    目前大部分的博客作者在用Word写博客这件事情上都会遇到以下3个痛点: 1.所有博客平台关闭了文档发布接口,用户无法使用Word,Windows Live Writer等工具来发布博客.使用Word写 ...

  6. mongodb-win32-i386-3.0.6 使用常见错误

    1.Error parsing YAML config file: yaml-cpp: error at line 3, column 28: unknown escape character: m ...

  7. python 3安装PDFMiner3K

    首先确保,你的pyhton是python 3 可在https://www.python.org/downloads/处下载 打开cmd,键入pip3 install pdfminer3k

  8. HRBUST1315 火影忍者之~大战之后 2017-03-06 16:14 54人阅读 评论(0) 收藏

    火影忍者之-大战之后 经历了大战的木叶村现在急需重建,人手又少,所以需要尽可能多的接受外来的任务,以赚取报酬,重建村庄,假设你现在是木叶的一名高级忍者,有一大堆的任务等着你来做,但毕竟个人时间有限,所 ...

  9. ubuntu 安装 zend studio

    hi,everyone!2014 年到了,是20你死还是爱你一世,世人不得而知.夜观天象,道德依旧在沦丧,经济依然在滑坡.行了,就整这几句.最近在折腾linux,这篇文章,没有什么意义.只是找找写bl ...

  10. access建立sql查询语句运行查询语句

    1.打开一个Access数据库文件 2.点击“创建”标签中的“查询设计”,会弹出一个“显示表”的对话框,点击“关闭”将其关闭 3.这时会有一个名为“查询*”的窗口,还不能输入SQL语句 4.点击左上角 ...