linux 编译PHP memcache扩展
在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扩展的更多相关文章
- linux php 安装 memcache 扩展
1. memcached依赖于libevent,需要先安装libevent. tar zxvf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-sta ...
- Linux 编译安装 php 扩展包 curl
php源码目录:/root/php php编译目录:/usr/local/webserver/php/ curl源码目录:/root/curl 1.curl,主要用于发送http请求,是php的一个扩 ...
- linux编译php gd扩展
1 安装gd的依赖包 yum -y install gd gd2 gd-devel gd2-devel zlib freetype 2 安装jpeg: wget http://www.ijg.org/ ...
- lamp环境编译安装curl扩展
Linux编译安装php扩展包curl 1.curl,主要用于发送http请求,是php的一个扩展包. 2.安装过程: (1)curl下载:http://curl.haxx.se/download.h ...
- linux上安装php7 memcache扩展 和 安装服务端memcached
linux上安装memcached不算太困难.唯一让本人感到困难的是 php7的memcache扩展安装.真的蛋疼! 先说安装服务端 memcached 1. 首先安装Libevent事件触发管理器. ...
- linux下安装PHP扩展memcache
公司的服务器 CentOS 7.5,PHP 5.6 下面都是最新的版本(支持到PHP5.6) 如需php7 下支持memcache扩展,请移步 https://www.cnblogs.com/h ...
- 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 ...
- linux下给php安装memcached及memcache扩展(转)
http://kimi.it/257.html (另外的方法)linux安装memcached及memcache扩展一.安装libevent函数库下载地址:http://libevent.org默认被 ...
- linux安装memcached及memcache扩展
一.安装libevent函数库 下载地址:http://libevent.org 默认被安装到:/usr/local/lib目录下 安装memcached之前需要先安装libevent函数库. 可以通 ...
随机推荐
- CRC32加密算法原理
[转]:https://blog.csdn.net/android_mnbvcxz/article/details/78902737
- C# Redis Server分布式缓存编程(二)(转)
出处;http://www.cnblogs.com/davidgu/p/3263485.html 在Redis编程中, 实体和集合类型则更加有趣和实用 namespace Zeus.Cache.Red ...
- [GO]go使用contextCancel
package main import ( "fmt" "context" ) func main() { gen := func(ctx context.Co ...
- Mysql--关于数值字段的比较问题
今天在进行数据库查询的过程中,因为需要比较一条记录中两个字段的大小问题 select * from cyber_download_rate where measure_time between '20 ...
- JScript 对象 <|> JSON
<script type="text/javascript"> function test(){ var array = [{"id":1},{&q ...
- (字典树)Revenge of Fibonacci -- HDU -- 4099
链接: http://acm.hdu.edu.cn/showproblem.php?pid=4099 要用c++交哦, G++ MLE 不是很懂,先粘上慢慢学习 代码: #include<std ...
- 企业搜索引擎开发之连接器connector(二十一)
从上文中的QueryTraverser对象的BatchResult runBatch(BatchSize batchSize)方法上溯到CancelableBatch类,该类实现了TimedCance ...
- Oracle EBS Export File Format
Profile Option Name Site Application Responsibility Server Server Org User Remark Export MIME type t ...
- (译)C#参数传递
前言 菜鸟去重复之Sql的问题还没有得到满意的答案.如果哪位大哥有相关的资料解释,能够分享给我,那就太谢谢了. 接触C#一年了,感觉很多东西还是很模糊,像C#中的委托和事件 有些东西看多了不用也还是不 ...
- 【译】ASP.NET MVC 5 官方教程 - 目录
ASP.NET MVC 5 官方教程 - 目录 [译]ASP.NET MVC 5 教程 - 1:入门 [译]ASP.NET MVC 5 教程 - 2:添加控制器 [译]ASP.NET MVC 5 教程 ...