首页 > Web开发 > 详细

linux下为PHP扩展安装memcache模块

时间:2014-07-16 19:15:05      阅读:334      评论:0      收藏:0      [点我收藏+]

linux下为PHP扩展安装memcache模块  

2011-09-05 13:31:00|  分类: linux|举报|字号 订阅

 
 
sh# wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
sh# wget http://www.monkey.org/~provos/libevent-1.4.6-stable.tar.gz
sh# wget http://pecl.php.net/get/memcache-3.0.1.tgz

sh# tar -zxvf libevent-1.4.6-stable.tar.gz
sh# cd libevent-1.4.6-stable
sh# ./configure -prefix=/usr/local/libevent
sh# make
sh# make install
sh# cd ../
sh# tar -zxvf memcached-1.2.6.tar.gz
sh# cd memcached-1.2.6
sh# ./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent
sh# make
sh# make install

 

安装php的memcache扩展

1 可以使用php自带的pecl安装程序
   # /usr/local/servers/php5/bin/pecl install memcache

 

2 sh# cd ../
sh# tar -zxvf memcache-3.0.1.tgz
sh# cd memcache-3.0.1
sh# /usr/local/bin/phpize (先要执行下这个,路径由: sh# which phpize 获取)
sh# ./configure -enable-memcache -with-php-config=/usr/local/bin/php-config -with-zlib-dir (路径由: sh# which php-config 获取)
sh# make
sh# make install (提示: Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ 则成功)

安装完后会有类似这样的提示:
Installing shared extensions: /usr/local/servers/php5/lib/php/extensions/no-debug-non-zts-20060922/

把这个记住,然后修改php.ini,把

extension_dir = "./"
修改为
extension_dir = "/usr/local/servers/php5/lib/php/extensions/"

并添加一行
extension="no-debug-non-zts-20060922/memcache.so"

memcache监视器: http://livebookmark.net/journal/ 的 memcache.php

memcache启动: sh# /usr/local/memcached/bin/memcached -u root -d -m 200 -l 10.2.0.88 -p 11211

linux下为PHP扩展安装memcache模块,布布扣,bubuko.com

linux下为PHP扩展安装memcache模块

原文:http://www.cnblogs.com/weixiahzixia/p/3844688.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!