在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

最新文章

  1. 12月4日PHPCMS模板
  2. Android AlertDialog去除黑边白边自定义布局(转)
  3. 【分享】国外后台界面HTML源码 [免费]
  4. FireFox每次访问页面时检查最新版本
  5. lkx开发日志2-第一次团队讨论
  6. WIN7无法记住远程登录密码
  7. SPOJ REPEATS 后缀数组
  8. 使用原生Sql查询实现按分类推送最新文章到首页
  9. Jmail组件发送邮件说明ASP.NET
  10. hud 2549 壮志难酬
  11. 【JAVA零基础入门系列】Day6 Java字符串
  12. 网页窗口logo图标设置
  13. webapi从入门到放弃(一)OWIN 自寄宿模式
  14. 虚拟机中linux系统的安装教程
  15. (Review cs231n) CNN in Practice
  16. 错误:软件包:3:docker-ce-18.09.4-3.el7.x86_64 (docker-ce-stable) 需要:container-selinux >= 2.9
  17. python实战学习之numpy学习
  18. [CodeForces - 447E] E - DZY Loves Fibonacci Numbers
  19. java在注解中绑定方法参数的解决方案
  20. FireDACQuery FDQuery New

热门文章

  1. 从iOS 11 UI Kit中谈谈iOS 11的新变化
  2. Forms in Angular 2
  3. spark VS mapreduce
  4. iphone在微信中audio 音频无法自动播放
  5. .NET基础 (16)事件
  6. linux 搭建php网站许愿墙
  7. 我的第一个博客&GuiHub简单练习
  8. Lucene索引的【增、删、改、查】
  9. [LeetCode 题解]: Partition List
  10. windows过滤指定IP