#!/bin/bash yum -y install openssl autoconf yum -y install lrzsz telnet* net-snmp-utils net-snmp gcc* man autoconf yum -y install libgcrypt-devel lrzsz perl-DBI perl-libwww-perl net-snmp-perl openssl-devel pcre-devel telnet nfs-utils rpcbind yum -y install libxml* yum -y install gcc gcc-c++ cmake ncurses-devel bison yum -y install bzip2-devel yum -y install curl-devel libpng-devel wget http://www.atomicorp.com/installers/atomic && sh ./atomic yum -y install php-mcrypt libmcrypt libmcrypt-devel yum -y install freetype-devel cd /data wget -N http://36.110.160.219/software/php/gd-2.0.32.tar.gz wget -N http://36.110.160.219/software/php/jpegsrc.v7.tar.gz wget -N http://36.110.160.219/software/php/libpng-1.2.10.tar.bz2 wget -N http://36.110.160.219/software/php/freetype-2.3.9.tar.bz2 wget -N http://36.110.160.219/software/php/fontconfig-2.4.2.tar.gz wget -N http://36.110.160.219/software/php/curl-7.44.0.tar.gz wget -N http://36.110.160.219/software/php/php-5.6.17.tar.gz tar zxvf gd-2.0.32.tar.gz tar zxvf jpegsrc.v7.tar.gz tar jxvf libpng-1.2.10.tar.bz2 tar jxvf freetype-2.3.9.tar.bz2 tar zxvf fontconfig-2.4.2 tar zxvf php-5.6.17.tar.gz tar zxvf curl-7.44.0.tar.gz mkdir /usr/local/{gd,jpeg,libpng,freetype,fontconfig} cd /data/jpeg-7 ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static make && make install cd /data/freetype-2.3.9 ./configure --prefix=/usr/local/freetype make && make install cd /data/fontconfig ./configure --with-freetype-config=/usr/local/freetype/bin/freetype-config make && make install cd /data/libpng-1.2.10 ./configure --prefix=/usr/local/libpng --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/fontconfig make && make install cd /usr/local/libpng/include/ wget -N http://36.110.160.219/software/php/pngconf.h wget -N http://36.110.160.219/software/php/png.h cd /data/gd-2.0.32 #wget -N http://36.110.160.219/software/php/pngconf.h #wget -N http://36.110.160.219/software/php/png.h #cp /usr/local/libpng/include/png.h ./ #cp /usr/local/libpng/include/pngconf.h ./ ./configure --prefix=/usr/local/gd --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/fontconfig make && make install cd /data/curl-7.44.0 ./configure --prefix=/usr/local/curl make && make install cd /data/php-5.6.17 ./configure --prefix=/data/php --with-config-file-path=/data/php/etc --with-mysql --with-pdo-mysql --with-mysqli --with-gd --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --with-curl=/usr/local/curl --enable-soap --enable-mbstring=all --enable-sockets --with-openssl --enable-fpm --enable-opcache --enable-mbstring --enable-zip --enable-ftp --enable-gd-jis-conv --enable-posix --enable-pcntl --with-mcrypt --with-zlib --with-bz2 --enable-debug --with-fpm-user=www --with-fpm-group=www --enable-xml --enable-bcmath --enable-inline-optimization --enable-mbregex --with-mhash --with-xmlrpc --with-pear --with-gettext --with-iconv --enable-exif --enable-fileinfo --enable-maintainer-zts --enable-gd-native-ttf --enable-sysvmsg --enable-sysvshm --enable-shmop --enable-sysvsem make && make install cp /data/php/etc/php-fpm.conf.default /data/php/etc/php-fpm.conf cp /data/php-5.6.17/php.ini-production /data/php/etc/php.ini /data/php/sbin/php-fpm -c /data/php/etc/php.ini cd /etc/init.d/ && wget -N http://36.110.160.219/software/php/php-fpm && chmod +x php-fpm chkconfig php-fpm on service php-fpm restart #php-mongo /data/php/bin/pecl install mongodb echo "extension=mongodb.so" >> `/data/php/bin/php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` #php-redis mkdir /data/package cd /data/package && wget http://pecl.php.net/get/redis-3.1.1.tgz tar zxvf 2.2.4.tar.gz && cd phpredis-2.2.4 && /data/php/bin/phpize ./configure --with-php-config=/data/php/bin/php-config make && make install > /tmp/phpredis.txt sed -i 's#Installing shared extensions: #extension_dir = "#g' /tmp/phpredis.txt sed -i 's#$#&"#g' /tmp/phpredis.txt cat /tmp/phpredis.txt >> `/data/php/bin/php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` echo "extension=redis.so" >> `/data/php/bin/php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` service php-fpm restart #memcache-扩展 #yum -y install autoconf #/data/php/bin/pecl install memcache #echo "extension=memcache.so" >> /data/php/etc/php.ini && service php-fpm restart #./configure --prefix=/opt/server/php --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --with-gd --with-curl --with-openssl --with-mcrypt --with-zlib --with-bz2 --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mhash --enable-mysqlnd --enable-sockets --enable-zip --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-pcntl --enable-fpm --enable-opcache #make && make install