linux php 安装 memcache 扩展
1. memcached依赖于libevent,需要先安装libevent。
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local/libevent
make
make install
2 安装memcached服务端
# wget http://www.memcached.org/files/memcached-1.4.20.tar.gz
# tar zxvf memcached-1.4.20.tar.gz
# cd memcached-1.4.20
# ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent
# make && make install
启动
/usr/local/memcached/bin/memcached -d -m 32 -u root -p 11211 -c 128 -P /usr/local/memcached/memcached.pid
参数说明
-d 选项是启动一个守护进程。
-u root 表示启动memcached的用户为root。
-m 是分配给Memcache使用的内存数量,单位是MB,默认64MB。
-M return error on memory exhausted (rather than removing items)。
-u 是运行Memcache的用户,如果当前为root 的话,需要使用此参数指定用户。
-p 是设置Memcache的TCP监听的端口,最好是1024以上的端口。
-c 选项是最大运行的并发连接数,默认是1024。
-P 是设置保存Memcache的pid文件。
3 php安装memcache扩展
wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar zxvf memcache-2.2.7.tgz
cd memcache-2.2.7
/usr/local/php/bin/phpize ### 生成configure 文件
./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config
make
make install
4 PHP安装memcached扩展
首先安装 扩展
# wget http://launchpadlibrarian.net/66527034/libmemcached-0.48.tar.gz
# cd libmemcached-0.48
# ./configure --prefix=/usr/local/libmemcached --with-memcached --with-libsasl-prefix --with-libsasl2-prefix --with-memcached-sasl
# make
make install
wget http://pecl.php.net/get/memcached-2.2.0.tgz
cd memcached-2.2.0
/usr/local/php/bin/phpize
./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
make
make install
编译完成后修改php.ini添加
extension=memcache.so
extension=memcached.so
重启php-fpm
5 测试是否安装成功
linux php 安装 memcache 扩展的更多相关文章
- linux 编译PHP memcache扩展
在Linux下编译memcache:memcache官网:http://memcached.org/前期准备:如果是虚拟机 保证虚拟机 联网安装依赖包yum -y install gcc make l ...
- win10 64位安装memcache扩展和开启redis扩展
前面有关于win10下搭建wamp环境的介绍,在此不在赘述,php操作memcache有memcache库和memcached库,其中memcache是php内置的扩展库,支持面向对象和面向过程两种操 ...
- linux下安装opcache扩展
linux下安装opcache扩展 参考:http://www.php.net/manual/zh/opcache.installation.php 1 2 3 4 5 6 7 wget http ...
- linux php安装zookeeper扩展
linux php安装zookeeper扩展 tags:php zookeeper linux ext 前言: zookeeper提供很犀利的命名服务,并且集群操作具有原子性,所以在我的多个项目中被采 ...
- phpStudy下安装memcache扩展
简要:参考<phpStydy配置memcache扩展>,期间安装不到memcache;为此向大家分享我遇到的问题和解决办法,希望能够跟各位PHP大神学习探索,如果有不对或者好的建议告知下: ...
- 总结 Linux 下安装 PHP 扩展步骤
总结一下 Linux 下安装 PHP 扩展步骤,这里以安装 PHP 的 redis 扩展为例. 一.拿到扩展包下载地址,下载扩展包 pecl 上搜索 redis wget http://pecl.ph ...
- CentOS环境PHP安装memcache扩展
安装memcache yum install memcached 安装libmemcached库 yum install libmemcached PHP安装Memcache扩展 root@blog. ...
- linux-CentOS6.4安装Memcached+memcached扩展+安装memcache扩展+Memcache+mecached同步SESSION的几种方法
一.编译环境的准备 yum install gcc yum install gcc-c++ libstdc++-devel yum install zlib-devel 二.源代码包准备 wget ...
- 安装memcached服务 和 php 安装memcache扩展
这是所有的命令,至于哪个命令是干嘛的自己悟去吧 ,顺便穿插一些知识点 安装libevent cd /home/ wget http://www.monkey.org/~provos/libeven ...
随机推荐
- css基础样式四
上次我们讲到了相对定位: 这次我们了解下绝对定位; 绝对定位: #box_relative { position: absolute; left: 30px; top: 20px; } 绝对定位会脱离 ...
- 如何静态添加toolbar到datagrid
这个示例向你展示如何添加toolbar到datagrid. 创建 DataGrid <table id="tt" class="easyui-datagrid&qu ...
- Mybatis映射文件
Mapper XML 文件 MyBatis 的真正强大在于它的映射语句,也是它的魔力所在.由于它的异常强大,映射器的 XML 文件就显得相对简单.如果拿它跟具有相同功能的 JDBC 代码进行对比,你会 ...
- 【leetcode❤python】 278. First Bad Version
#-*- coding: UTF-8 -*-# The isBadVersion API is already defined for you.# @param version, an integer ...
- GOLANG 基本数据类型 整型
基本数据类型-整型 种类 有符号(负号) int8 int16 int32 int64 无符号(无符号) uint8 uint16 uint32 uint64 架构特定(取决于系统位 ...
- 微信小程序-表单
wxml <view> 按钮: <button size="{{buttom.size}}" type="{{buttom.type}}" p ...
- python http代理代码
googlecode :https://code.google.com/archive/p/python-proxy/source/default/source # -*- coding: cp125 ...
- HTML 在安卓手机端软键盘弹出顶起页面布局的解决办法
$('body').height($('body')[0].clientHeight); 以上是背景即BODY被顶起的解决办法. 如果是footer被顶起,则可以用判断解决, $('input').f ...
- 使用Gson转换json数据为Java对象的一个例子
记录工作中碰到的一个内容. 原料是微信平台的一个接口json数据. { "errcode" : 0, "errmsg" : "ok", &q ...
- [Unity] Android插件
1> 编写eclipse android代码. 2> 把unity下class.jar拷入eclipse libs目录下, 工程中右键build path, add to build pa ...