PHP7安装Memcached扩展

安装依赖库 libmemcached
$ wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
$ tar -zxf libmemcached-1.0.18.tar.gz
$ cd libmemcached-1.0.18/
$ ./configure
$ make && make install
安装php7的memcached扩展
$ git clone https://github.com/php-memcached-dev/php-memcached.git
$ cd php-memcached/
$ git checkout php7
$ phpize  # 如果未安装php-dev需先安装
$ ./configure --disable-memcached-sasl
$ make && make install
启动扩展

修改配置文件

$ sudo vim /etc/php/7.0/fpm/php.ini

在末尾添加

[Memcached]
extension=memcached.so

重启php

$ sudo systemctl restart php7.0-fpm
    原文作者:lianginet
    原文地址: https://www.jianshu.com/p/3a3636e5a8c4
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞