#!/bin/bash yum -y install openssl autoconf vim make wget yum -y install libevent libevent-devel 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 bzip2 yum -y install bzip2-devel yum -y install epel-release yum -y update yum -y install mcrypt libmcrypt libmcrypt-devel libjpeg-devel yum -y install curl-devel libpng libpng-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/libiconv-1.15.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-7.2.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-7.2.17.tar.gz tar zxvf curl-7.44.0.tar.gz tar zxvf libiconv-1.14.tar.gz mkdir /usr/local/{gd,jpeg,libpng,freetype,fontconfig,libiconv} 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-2.4.2 ./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 ./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/libiconv-1.15 ./configure --prefix=/usr/local/libiconv make && make install echo '/usr/local/lib64 /usr/local/lib /usr/lib /usr/lib64'>>/etc/ld.so.conf&&ldconfig -v cd /data/php-7.2.17 ./configure --prefix=/data/php/ --with-config-file-path=/data/php/etc --with-mysqli --with-pdo-mysql --with-gd --with-curl --with-openssl --with-zlib --with-bz2 --with-xmlrpc --with-gettext --with-pear --with-libxml-dir --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --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-zlib --with-bz2 --enable-debug --with-fpm-user=www --with-fpm-group=www --enable-xml --enable-bcmath --enable-inline-optimization --enable-mbregex #./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 --disable-fileinfo --enable-maintainer-zts --enable-gd-native-ttf --enable-sysvmsg --enable-sysvshm --enable-shmop --enable-sysvsem ###./configure --prefix=/data/php --with-config-file-path=/data/php/etc --with-mysql --with-mysqli --with-pdo-mysql --with-gd --with-curl --with-openssl --with-mcrypt --with-zlib --with-bz2 --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mhash --with-iconv=/usr/local/libiconv --enable-mysqlnd --enable-sockets --enable-zip --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-posix --enable-pcntl --enable-shmop --enable-opcache --enable-fileinfo --enable-fpm --with-xmlrpc --with-gettext --with-pear --enable-maintainer-zts --enable-inline-optimization --enable-fileinf --enable-sysvsem --enable-bcmath --disable-rpath --enable-xml #-with-pear --with-jpeg-dir --with-png-dir --with-freetype-dir --with-webp-dir --with-iconv-dir --with-libxml-dir --enable-mysqlnd --enable-sockets --enable-soap --enable-zip --enable-mbstring --enable-mbregex --enable-ftp --enable-gd-jis-conv --enable-posix --enable-pcntl --enable-opcache --enable-fileinfo --enable-maintainer-zts --enable-inline-optimization --enable-shmop --enable-sysvsem --enable-bcmath --disable-rpath --enable-xml --enable-fpm make -j 2 && make install useradd -s /sbin/nologin www cp /data/php/etc/php-fpm.conf.default /data/php/etc/php-fpm.conf cp /data/php-7.2.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 cp /data/php/etc/php-fpm.d/www.conf.default /data/php/etc/php-fpm.d/www.conf 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*||"` cd /data/package && wget -N http://36.110.160.219/software/php/mongodb-1.6.0.tgz tar zxvf mongodb-1.6.0.tgz && cd mongodb-1.6.0 ./configure --with-php-config=/data/php/bin/php-config make && make install echo "extension=mongodb.so" >> /data/php/etc/php.ini #php-redis mkdir /data/package cd /data/package && wget wget -N http://36.110.160.219/software/php/redis-5.2.1.tgz tar zxvf redis-5.2.1.tgz && cd redis-5.2.1 && /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