安装PHP及Memcache扩展
安装PHP及Memcache扩展
1. 下载
(1)libevent
官方网页:http://monkey.org/~provos/libevent/
下载命令:
- wget http://monkey.org/~provos/libevent-2.0.13-stable.tar.gz
(2)libmemcached
官方网页:https://launchpad.net/libmemcached/+download
下载命令:
- wget http://launchpad.net/libmemcached/1.0/0.52/+download/libmemcached-0.52.tar.gz
(3)PHP
官方网页:http://cn2.php.net/get/php-5.3.8.tar.gz/from/a/mirror
下载命令:
- wget http://cn2.php.net/get/php-5.3.8.tar.gz/from/cn.php.net/mirror
(4)Memcached服务器端
下载命令:
- wget http://memcached.googlecode.com/files/memcached-1.4.7.tar.gz
(5)Memcache For PHP Module
官方网页:http://pecl.php.net/package/memcache
下载命令:
- wget http://pecl.php.net/get/memcache-3.0.6.tgz
2. 安装Memcached服务器端
(1)安装libevent
- tar -zxvf libevent-2.0.13-stable.tar.gz
- cd libevent-2.0.13-stable
- ./configure
- make
- make install
(2)安装Memcached
- tar -zxvf memcached-1.4.7.tar.gz
- cd memcached-1.4.7
- ./configure --prefix=/usr/local/memcached
- make
- make install
3. 安装PHP
(1)安装libxml2
- sudo apt-get install libxml2-dev
(2)解压编译
- tar -zxvf php-5.3.8.tar.gz
- cd php-5.3.8
- ./configure
- make
- make install
4. 安装Memcache for PHP Module
(1)解压编译
- tar -zxvf memcache-3.0.6.tgz
- cd memcache-3.0.6
- /usr/local/bin/phpize
- ./configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config --with-zlib-dir
- make
- make install
在运行 "make install" 的后,得到:
- Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
(2)修改php.ini文件
找到如下代码:
- extension_dir = "./"
修改为 make install 后得到的目录。
- extension = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626/"
增加 extension 属性,设置为
- extension = memcache.so
5. 测试
(1)编写测试文件
- <?php
- $mem = new Memcache;
- $mem->connect("127.0.0.1", 12121);
- $mem->set('key', 'This is a test!', 0, 60);
- $val = $mem->get('key');
- echo $val;
- ?>
(2)运行测试文件
- php -c /etc/php5/cgi/php.ini test.php
(3)结果检验
如果没有error,就是OK了。
安装PHP及Memcache扩展的更多相关文章
- centos'的yum安装php的memcache扩展
centos'的yum安装php的memcache扩展 博客分类: linux 让php能使用memcached服务的扩展有两种:memcache 和 memcached 1. 先安装libmem ...
- linux centos 安装php的memcache扩展
一.centos6.5 yum安装php的memcache扩展 搜索memcache yum search memcache 有了,现在可以安装了 yum -y install memcached m ...
- linux下给php安装memcached及memcache扩展(转)
http://kimi.it/257.html (另外的方法)linux安装memcached及memcache扩展一.安装libevent函数库下载地址:http://libevent.org默认被 ...
- 安装php的memcache扩展
linux: 安装环境 RHEL 4 Php 5.2.6 所需软件 libevent-1.4.6-stable.tar.gz (http://monkey.org/~provos/libevent/) ...
- window下安装php7的memcache扩展
安装memcache:http://www.runoob.com/memcached/memcached-connection.html1.4.4 c:\memcached\memcached.exe ...
- linux安装memcached及memcache扩展
一.安装libevent函数库 下载地址:http://libevent.org 默认被安装到:/usr/local/lib目录下 安装memcached之前需要先安装libevent函数库. 可以通 ...
- linux-memcache安装及memcached memcache扩展
linux memcached安装yum -y install libevent libevent-deve yum list memcached yum -y install memcached m ...
- PHP安装sqlsrv和memcache扩展步骤
做了两天的实验才终于摸清楚如何将PHP连接上sqlserver数据库,以及怎样通过修改virtualhost文件来重定向,因为走得弯路比较多所以很想分享一下这次的心路历程. 第一步:安装wamp等类似 ...
- mac 下安装php7.1 memcache扩展
1.下载memcache源代码文件 https://github.com/websupport-sk/pecl-memcache/archive/php7.zip 文件夹名为:pecl-memcach ...
随机推荐
- JavaScript怎样学
嘿,我最近接到一个 Web 项目,不过老实说,我这两年没怎么接触 Web 编程,听说 Web 技术已经发生了一些变化.听说你是这里对新技术最了解的 Web 开发工程师? 准确地说,我是一名「前端工程师 ...
- IIS "rewrite.dll failed to load. The data is the error." 错误解决方法
在Windows 10 build 17133.73上部署一个较老版本的ASP.NET 2.0程序,访问时候出现: Service Unavailable HTTP Error 503. The se ...
- 新浪的动态策略灰度发布系统:ABTestingGateway
原文链接:http://www.open-open.com/lib/view/open1439889185239.html ABTesingGateway 是一个可以动态设置分流策略的灰度发布系统,工 ...
- iOS - 处理计算精度要求很高的数据,floatValue,doubleValue等计算不精确问题
.问题描述:服务器返回的double类型9...94的数字时 .之前处理方式是 :(从内存.cpu计算来说double都是比较合适的,一般情况下都用double) goodsPrice.floatVa ...
- POJ2387-Till the cows come home【最短路】
A - Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn t ...
- (转载)准确率(accuracy),精确率(Precision),召回率(Recall)和综合评价指标(F1-Measure )-绝对让你完全搞懂这些概念
自然语言处理(ML),机器学习(NLP),信息检索(IR)等领域,评估(evaluation)是一个必要的工作,而其评价指标往往有如下几点:准确率(accuracy),精确率(Precision),召 ...
- Oracle HA 之 测试RAC的功能
作用:在oracle数据库instance级别的冗余,其中只要有一个instance可用即可保证可用性,但是不能保准数据级别的错误. 数据库文件需要放置在共享存储上,理论上一个实例对应一个数据库,实例 ...
- 洛谷P1903 数颜色 [国家集训队] 莫队
正解:带修莫队 解题报告: 可以理解为引入时间参数,然后就是有了仨参数,关于这个修改同样的是,如果时间是相同的,不用搞,如果时间不相同做一下时光倒流/时光推移就成嘛 但是肯定既然这样的话,按照原来的s ...
- 如何下载Bilibili视频
方法1: https://www.bilibili.com/video/av25940642 (源网址) https://www.ibilibili.com/video/av25940642 (新网址 ...
- CentOS 6 网络设置
系统配置: 系统硬件:vmware workstation 系统版本:Centos-6.6-x86_64 路由器网关:192.168.1.1 linux系统网络设置须知: 1.主机所有网卡信息配置文件 ...