码迷,mamicode.com
首页 > 系统相关 > 详细

centos7编译安装memcached

时间:2018-05-05 16:51:30      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:cal   守护   files   comm   php.ini   守护进程   源码   fpm   mem   

1.libevent

  源码地址:https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz

  1)  ./configure --prefix=/usr --disable-static

  2) make && make install

2.memcached

   源码地址: http://www.memcached.org/files/memcached-1.4.24.tar.gz

   1) ./configure --prefix=/usr/local/memcached-1.4.24/  --with-libevent=/usr

   2) make && make install

3.启动memcahed

  /usr/local/memcached-1.4.24/bin/memcached -d -u root -l 127.0.0.1 -p 11211 -m 100 -P /var/run/memcached_11211.pid

  -d:  守护进程模式运行

  -m: 分配内存

  -P: pid文件保存位置

4.终止memcahed

kill cat memcached_11211.pid

5.libmemcached

源码地址: https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz 
   1) ./configure --prefix=/usr/local/libmemcached-1.0.18

   2) make && make install

6.php7版本下安装 php-memcached 扩展

  1) get clone  https://github.com/php-memcached-dev/php-memcached -b php7 php-memcached

  2) tar zxvf  php-memcached

  3) cd php-memcached

  4) phpize

       5) ./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached-1.0.18 --disable-memcached-sasl

       6) make && make install

安装成功后,vim php.ini ,添加extension=memcached.so,重启php-fpm。



  

 

centos7编译安装memcached

标签:cal   守护   files   comm   php.ini   守护进程   源码   fpm   mem   

原文地址:https://www.cnblogs.com/AndrewGhost/p/8994977.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!