前端之家收集整理的这篇文章主要介绍了
Centos 安装 memcached 完整脚本,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#!/bin/bash
echo "91.189.89.223 launchpad.net" >> /etc/hosts
echo "91.189.89.229 launchpadlibrarian.net" >> /etc/hosts
echo "104.236.228.160 pecl.PHP.net" >> /etc/hosts
echo "192.30.255.113 github.com" >> /etc/hosts
cd /tmp
rm -rf libmemcached-1.0.18.tar.gz
rm -rf libmemcached-1.0.18/
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
cd /tmp
rm -rf master.zip
rm -rf igbinary-master/
wget https://github.com/igbinary/igbinary/archive/master.zip
unzip master.zip
cd /tmp/igbinary-master
/usr/local/PHP/bin/PHPize
./configure --with-PHP-config=/usr/local/PHP/bin/PHP-config
make && make install
cd /tmp
rm -rf memcached-2.2.0.tgz
rm -rf memcached-2.2.0/
wget https://pecl.PHP.net/get/memcached-2.2.0.tgz
tar -zxf memcached-2.2.0.tgz
cd memcached-2.2.0
/usr/local/PHP/bin/PHPize
./configure --enable-memcached-igbinary --with-PHP-config=/usr/local/PHP/bin/PHP-config
make && make install
echo extension=/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20131226/igbinary.so >> /usr/local/PHP/lib/PHP.ini
echo extension=/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20131226/memcached.so >> /usr/local/PHP/lib/PHP.ini
/usr/local/Nginx/sbin/Nginx -s reload
/usr/local/PHP/bin/PHP -m | grep igbinary
/usr/local/PHP/bin/PHP -m | grep memcached
pkill PHP-fpm
/usr/local/PHP/sbin/PHP-fpm
echo 'install complete'
原文链接:https://www.f2er.com/centos/376504.html