CnSwift - 雨燕

agile development - 敏捷开发

PHP7安装Memcached扩展

在Ubuntu 1604已经搭建LAMP(Ubuntu 1604,Apache2,MySQL5.7,PHP7)环境,并且已安装Memcached。下面我们一起来安装memcached扩展:

一、安装libmemcached

1
2
3
4
5
$ wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
$ tar zxvf libmemcached-1.0.18.tar.gz
$ cd libmemcached
$ ./configure --prefix=/usr/local/libmemcached
$ make && make install

二、安装memcached扩展

1
2
3
4
5
6
7
8
$ cd /usr/local/src
$ git clone https://github.com/php-memcached-dev/php-memcached
$ cd php-memcached
$ git checkout php7
$ phpize
$ sudo ./configure --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl
$ make
$ make install

三、修改php.ini

添加(extension=”memcached.so”)

1
$ sudo vim /etc/php/7.0/apache2/php.ini

重启Apache

1
$ sudo /etc/init.d/apache2 restart

重启php7.0-fpm

1
$ sudo /etc/init.d/php7.0-fpm restart

重启memcached

1
$ sudo /etc/init.d/memcached restart
更多精彩内容,请关注公众号 Golang语言开发栈公众号二维码
感谢赞赏.

Welcome to my other publishing channels