#!/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'
Centos 安装 memcached 完整脚本
最新推荐文章于 2024-10-30 11:26:58 发布