ubuntu 17.10 安装php 7.1以及gd,redis和memcache扩展

/ 0评 / 0

dpkg命令见:http://www.cnblogs.com/windtail/archive/2012/06/02/2623175.html

 

gd库直接下载 deb包安装;

dpkg -i php7.1-gd_7.1.11-1+ubuntu17.10.1+deb.sury.org+1_amd64.deb

 

redis扩展:pecl install redis

memcache扩展:apt-get install php7.1-memcache

编译安装:

apt install php7.1-dev

phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

 

vim /etc/php/7.1/fpm/php.ini

加入如下两行:

extension=redis.so

extension=memcache.so

重启服务器:

systemctl restart php7.1-fpm.service

systemctl restart nginx.service

 

zlib没找到,如果是debian,ubuntu的话装zlib1g-dev,centos之类的装个zlib-devel

 

新版的客户端基于libmemcached,所以必须要安装libmemcached 

https://launchpad.net/libmemcached

./configure --prefix=/usr/local/libmemcached  --with-memcached
make && make install

 

网站效率:0.303秒内查询了24次数据库