sudo apt-get install php7.0-dev
sudo apt-get install libevent-dev
sudo apt-get install pkg-config
sudo pecl install igbinary
cd ~
mkdir tmp
cd tmp/
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar xzvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
libmemcached-1.0.18$ ./configure
./configure
make
sudo make install
https://github.com/php-memcached-dev/php-memcached/tree/php7
unzip php-memcached-php7.zip
cd php-memcached-php7/
phpize7.0
./configure --enable-memcached-igbinary --disable-memcached-sasl
make
sudo make install
php -i | grep mem
cp json.ini igbinary.ini
vi igbinary.ini :
extension=igbinary.so
cp json.ini memcached.ini :
extension=memcached.so
cd ../cli/conf.d/
sudo ln -s ../../mods-available/igbinary.ini 20-igbinary.ini
sudo ln -s ../../mods-available/memcached.ini 20-memcached.ini
cd ../../apache2/conf.d/
sudo ln -s ../../mods-available/igbinary.ini 20-igbinary.ini
sudo ln -s ../../mods-available/memcached.ini 20-memcached.ini
sudo service apache2 restart
----- 如果上面安装 memcached 出现错误,导致安装不成功,请使用下面的命令代替 --------
sudo apt-get install -y php7.0-dev git pkg-config build-essential libmemcached-dev
[ sudo apt-get -f install ] -- 上一句命令提示有误时执行这句 --
cd ~
git clone https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached
git checkout php7
phpize
./configure --disable-memcached-sasl
make
sudo make install
共同学习,写下你的评论
评论加载中...
作者其他优质文章