Linux安装php扩展memcache
来源:互联网 发布:淘宝网小号怎么买 编辑:程序博客网 时间:2024/06/10 09:27
mecache是一个自由和开放源代码、高性能、分配的内存对象缓存系统,用于加速动态web程序,减轻数据库负载。它可以应对任意多个链接,使用非阻塞的网络IO,它的工作机制是在内存中开辟一块空间,然后建立一个HashTable,Memcached自管理这些HashTable。
在安装之前,首先需要说明的是,memcache与memcached的区别,memcache是客户端的扩展,memcached是服务端。
php扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法。
- wget -c http://pecl.php.net/get/memcache-3.0.6.tgz
- tar xzvf memcache-3.0.6.tgz
- cd memcache-3.0.6
2、执行phpize扩展安装程序,假设phpzie的路径为/usr/local/php/bin/phpize,具体的路径得根据自己的环境修改。
- /usr/local/php/bin/phpize
3、开始安装扩展memcache
- ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
- make && make install
4、最后修改php.ini文件,在zend之前加入如下代码。
- [memcache]
- extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
- extension=memcache.so
#yum install libevent-devel
如果不支持yum的系统,可以这样装libevent
# cd /usr/local/src
# wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz # tar vxf libevent-1.4.12-stable.tar.gz # cd libevent-1.4.12
# ./configure --prefix=/usr/local/libevent # make && make install
接续安装
memcached
接续安装memcached# cd /usr/local/src
# wget http://cloud.github.com/downloads/saberma/saberma.github.com/memcached-1.4.4.tar.gz
# tar vxf memcached-1.4.4.tar.gz # cd memcached-1.4.4
# ./configure --prefix=/usr/local/memcached # make && make install
安装完后启动memcached并分配32m内存(32为使用内存数,可按自身情况修改)
/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root
将memcached加入启动项 # vi /etc/rc.d/rc.local 按键盘上的 i 开始编辑 在最后加入
/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root
按Esc键,再输入
:wq 保存退出
如果需要,可以reboot一下,不过不用reboot应该已经生效~
- Linux安装php扩展memcache
- Linux安装php扩展memcache
- linux php安装memcache扩展
- linux(ubuntu) memcache安装及php的memcache扩展安装
- Linux下PHP安装Memcache扩展
- Linux中安装memcache及其php扩展
- Linux下php安装memcache扩展
- Linux下php安装memcache扩展
- 【教程】Linux安装php扩展memcache
- linux centos 安装php的memcache扩展
- 安装 PHP Memcache 扩展
- php安装memcache扩展
- php安装memcache扩展
- php安装memcache扩展
- php安装memcache扩展
- PHP memcache扩展安装
- Linux安装memcache扩展
- Linux安装Memcache与安装php memcached扩展
- ActionBar最近学习整理之三:焦点控制及菜单项构建
- 嵌入式 移植FTP到ARM2410
- websphere性能优化的几个方法
- 字符编码转换
- 网站后台统计数据分析
- Linux安装php扩展memcache
- 孙鑫C++教程笔记5
- 在64位系统下连接Access数据库的问题The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine
- PID 60 线段树树形转线性
- 用foreach迭代显示在form里,input输入框的name相同的解决方法
- 常用jar包用途
- JS验证身份证号码
- android UI进阶之用ViewPager实现欢迎引导页面
- Android Camera开发