ITPub博客

首页 > IT职业 > IT图书 > php的memcache安装

php的memcache安装

IT图书 作者:LeeC 时间:2021-09-09 09:34:13 0 删除 编辑

1、安装libevent


memcached基于livevent的事件处理,所以首先安装libevent,用yum安装的话版本较低,所以编译安装

#tar zxvf libevent-1.4.13-stable.tar.gz

#cd libevent-1.4.13-stable

#./configure&& make&& make install


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


2、安装memcached


#tarzxvf memcached-1.4.5.tar.gz

#./configure

#make && make install


安装完成后,memcached的默认目录为/usr/local/bin/memcached


添加链接库到ld.so.conf

#echo “/usr/local/lib”>>/etc/ld.so.conf

#ldconfig


启动memcached:

/usr/local/bin/memcached –m128 –p 11211 –d –u root –P /var/run/memcached.pid –vv


测试:telnet localhost 11211


关闭memcached: #kill` cat /var/run/memcached.pid`


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


3、安装memcache的php扩展

首先,打开phpize

#/usr/local/php5/bin/phpize

#tar zxvf memcache-2.2.5.tar.gz

#./configure –eanble-memcache–with-php-config=/usr/local/php5/bin/php-config

#make && makeinstall


然后根据提示,把生成的.so文件加入到php.ini里面



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4352/viewspace-2804810/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: python入门:字典
下一篇: Grid布局指南
请登录后发表评论 登录
全部评论

注册时间:2019-08-12

  • 博文量
    86
  • 访问量
    659