linux安装memcache及memcache扩展
一、安装libevent
# wget http://www.monkey.org/~provos/libevent-2.0.12-stable.tar.gz
# tar zxf libevent-2.0.12-stable.tar.gz
# cd libevent-2.0.12-stable
#./configure --prefix=/usr/local/lib
# make && make install
二、下载安装最新版本:http://memcached.org/downloads
# wget http://memcached.org/files/memcached-1.4.20.tar.gz
# cd memcached-1.4.20
#./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/lib && make && make install
三、配置启动
# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/usr/sbin/ntpdate ntpupdate.tencentyun.com >/dev/null 2>&1 &
/usr/local/agenttools/agent/startagent.sh /usr/local/agenttools/agent /dev/null
#secu-tcs-agent bootstart, install at Tue Apr 29 17:21:38 CST 2014.
/usr/local/sa/agent/secu-tcs-agent-mon-safe.sh > /dev/null 2>&1
/usr/local/memcached/bin/memcached -p 12677 -U 0 -d -r -u root -m 2040 -c 1024 -t 4
保存后退出,手动启动服务
# /usr/local/memcached/bin/memcached -p 12677 -U 0 -d -r -u root -m 2040 -c 1024 -t 4
注:如果出现/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory异常在/etc/ld.so.conf中加入/usr/local/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可。
# vi /etc/ld.so.conf
# /sbin/ldconfig -V
四、测试memcached
# telnet 127.0.0.1 12677
出现以下信息表示启动成功
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Linux下php安装memcache扩展
安装环境:CentOS 6.4
PHP扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法。
1、下载
下载地址:http://pecl.php.net/package/memcache
文件名:memcache-3.0.8.tgz
文件下载成功后上传至/usr/local目录
2、安装
[root@vm15 local]# tar -zxvf memcache-3.0.8.tgz
root@vm15 local]# cd memcache-3.0.8
[root@vm15 memcache-3.0.8]# /usr/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
[root@vm15 memcache-3.0.8]# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir 或者直接./configure
[root@vm15 memcache-3.0.8]# make
[root@vm15 memcache-3.0.8]# make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
[root@vm15 memcache-3.0.8]# ll /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
total 2140
-rwxr-xr-x. 1 root root 453766 Dec 30 17:44 memcache.so
-rwxr-xr-x. 1 root root 861055 Dec 30 16:47 Redis.so
出现memcache.so就表明安装成功了
tips:
configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
yum 安装 #yum install zlib-devel
3、配置支持php
[root@vm15 memcache-3.0.8]# vi + /usr/local/php/lib/php.ini
添加
extension=memcache.so
:wq! #保存退出
4、重启服务
#/etc/init.d/php-fpm restart
linux安装memcache及memcache扩展的更多相关文章
- linux安装memcached及memcache扩展
一.安装libevent函数库 下载地址:http://libevent.org 默认被安装到:/usr/local/lib目录下 安装memcached之前需要先安装libevent函数库. 可以通 ...
- linux安装配置Redis,Swoole扩展
我是使用的是lnmp环境(php5.6.3) 一.安装redis数据库(参考w3c手册) 下载地址:http://redis.io/download 本教程使用的最新文档版本为 2.8.17,下载并安 ...
- Linux安装PHP的Redis扩展(已安装Redis)
1.下载需要的php操作redis的扩展包 下载地址 http://pecl.php.net/package/redis 下载对应php版本,我的php版本为7.3,下载的是最新的版本5.0.2 ...
- Linux安装php的Redis扩展
1.安装redis 下载:https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz 上传phpredis-2.2.4.tar.gz到/usr ...
- linux 安装 ImageMagick 和 imagick 扩展
使用命令安装 1.依次运行以下命令 yum install ImageMagick yum install ImageMagick-devel yum install php-pear 安装php-p ...
- linux下给php安装memcached及memcache扩展(转)
http://kimi.it/257.html (另外的方法)linux安装memcached及memcache扩展一.安装libevent函数库下载地址:http://libevent.org默认被 ...
- Linux下的Memcache安装及安装Memcache的PHP扩展安装
Linux下Memcache服务器端的安装服务器端主要是安装memcache服务器端,目前的最新版本是 memcached-1.3.0 .下载:http://www.danga.com/memcach ...
- Linux安装php扩展memcache
Linux安装php扩展memcache php扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法.1.下载并解压memcache文件 wget -c http ...
- Linux 安装基于(PHP5.5)memcache扩展
一. memcache服务器端 下载地址:http://memcached.org/ 安装memcached,同时需要安装中指定libevent的安装位置 tar zxvf memcached-1.2 ...
- linux centos 安装php的memcache扩展
一.centos6.5 yum安装php的memcache扩展 搜索memcache yum search memcache 有了,现在可以安装了 yum -y install memcached m ...
随机推荐
- 2018-2019-2 《网络对抗技术》Exp7 网络欺诈防范 Week10 20165233
Exp7 网络欺诈防范 目录 一.基础问题 二.实验步骤 实验点一:简单应用SET工具建立冒名网站 实验点二:ettercap DNS spoof 实验点三:结合应用两种技术,用DNS spoof引导 ...
- **字符串格式化:%和.format
字符串格式化:%和.format .format在许多方面看起来更便利.对于%最烦人的是它无法同时传递一个变量和元组.你可能会想下面的代码不会有什么问题: "hi there %s" ...
- overflow与underflow
是新近的firefox浏览器中支持overflow, underflow这两个事件,当某一元素的大小超出父元素的显示范围就会触发overflow事件,如果从超出显示再变回不超出的状态则触发underf ...
- tnsping命令解析
tnsping命令格式: tnsping <service_name> n n的意义是可以让tnsping ping多次 例: c:\Documents and Settings\Tony ...
- 中文分词工具jieba中的词性类型
jieba为自然语言语言中常用工具包,jieba具有对分词的词性进行标注的功能,词性类别如下: Ag 形语素 形容词性语素.形容词代码为 a,语素代码g前面置以A. a 形容词 取英语形容词 adje ...
- WPF Shader 正片叠底
新建文本文档拷贝以下代码 //正片叠底sampler2D implicitInput : register(s0);sampler2D oldInput : register(s1);float4 m ...
- java 蓝桥杯算法提高 矩阵乘法
思路:根据提示的内容,我们可以得到c[i][j] += a[i][k]*b[k][j],k>=0&&k<s PS:这道题本身不难,但是当我定义A[m][s] B[s][n] ...
- DVI与VGA有什么区别
[DVI与VGA有什么区别] DVI接口的传输信号采用全数字格式,与之对应的是采用模拟信号的VGA接口. VGA和DVI的区别,首先VGA模拟信号的传输比较麻烦,首先是将电脑内的数字信号转换为模拟信号 ...
- 使用opencv-python画OpenCV LOGO
OpenCV2-Python 官方教程的练习 代码: #-*- coding:utf-8 -*- import numpy as np import cv2 img = np.zeros((512, ...
- C#在控制台输出异常所在的行数
对于异常,我们经常用try-catch语句来处理,一种常见的方式是在catch语句块用MessageBox.Show("异常")这种弹窗的方式来报告异常.但是有些时候,有些异常发生 ...