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'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值