memcached redis

要安裝的是
1. libmemcached
1. memcached 服務
2. memcached php extension

注意 要安裝   pkg-config  zlib1g-dev

安裝順序
這個位於 https://libmemcached.org/libMemcached.html
libmemcached-1.0.18.tar.gz

裝完後再安裝   apt-get install libmemcached-tools
libevent-2.1.8-stable.tar.gz
這個位於 http://libevent.org/

memcached-1.5.10.tar.gz
這個位於 https://memcached.org/downloads

memcached-3.0.4.tgz
這個位於 pecl

這四個都要

1.下载文件:
https://launchpad.net/libmemcach … ached-1.0.18.tar.gz
tar -zxvf libmemcached-1.0.18.tar.gzcd libmemcached-1.0.18
./configure –prefix=/usr/local/libmemcached

php5.6 最大只能用  memcached-2.2.0

apt-get install pkg-config
apt install php7.0-dev
wget https://pecl.php.net/get/memcached-3.0.4.tgz
tar -zxvf memcached-3.0.4.tgz
cd  memcached-3.0.4
./configure –with-libmemcached-dir=/usr/local –disable-memcached-sasl

./configure  –disable-memcached-sasl  -with-php-config=/usr/local/vesta/php/bin/php-config  –with-libmemcached-dir=/usr/local/

千萬注意 php5.6 和 php7.0X 以上用的版本不一樣  php5.6 最大只能用  memcached-2.2.0
./configure –enable-memcached –with-php-config=/usr/bin/php-config –with-libmemcached-dir=/usr/local/ –disable-memcached-sasl

1.安裝 libevent-2.1.8https://github.com/libevent/libe … 2.1.8-stable.tar.gz
tar xzvf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable.tar.gz
./configure
make & make install

2.memcached-1.5.10.tar.gz
cd libevent-2.1.8-stable./configure
make & make install

sudo ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib/libevent-2.1.so.6

apt-get install -y pkg-config
git clone https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached/
git checkout php7
phpize
./configure –disable-memcached-sasl
make
make install

2. redis
git clone https://github.com/phpredis/phpredis.git
cd phpredis/
git checkout php7
phpize
./configure
make
make install

/usr/local/bin/memcached -p 11211 -m 64m -d -u root放在
nano /etc/rc.local  
自動執行