#!/bin/bash
path=/opt/software
[ -d $path ] && : || mkdir -p $path
yum install -y libxml2-devel \
libjpeg libjpeg-devel \
php-mysql libjpeg-turbo-devel \
freetype-devel libpng \
libpng-devel gd-devel \
libcurl-devel libxslt-devel \
libxslt-devel zlib-devel \
libxml2-devel freetype-devel \
libpng-devel gd-devel \
libxslt-devel curl-devel \
net-snmp net-snmp-devel
#libconv部分
cd $path
[ -f libiconv-1.14.tar.gz ] && : || wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
\rm -rf $path/libiconv-1.14 && tar xf $path/libiconv-1.14.tar.gz
cd $path/libiconv-1.14
./configure --prefix=/usr/local/libiconv
[ $? -eq 0 ] && : || (echo "configure libiconv error" && exit 2)
make && make install
#libmrypt部分
cd $path
[ -f libmcrypt-2.5.8.tar.gz ] && : || wget http://nchc.dl.sourceforge.net/pr oject/mcrypt/Libmcrypt/2.5.8/libmcrypt -2.5.8.tar.gz
tar zxf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
[ $? -eq 0 ] && : || (echo "configure libmcrypt error" && exit 2)
make && make install
/sbin/ldconfig && cd libltdl/
./configure --enable-ltdl-install
make && make install
#mhash部分
cd $path
[ -f mhash-0.9.9.9.tar.gz ] && : || wget http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
tar zxf mhash-0.9.9.9.tar.gz && cd mhash-0.9.9.9
./configure
[ $? -eq 0 ] && : || (echo "configure mhash error";exit 2)
make && make install
#mcrypt部分
cd $path
[ -f mcrypt-2.6.8.tar.gz ] && : || wget http://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
tar zxf mcrypt-2.6.8.tar.gz && cd $path/mcrypt-2.6.8
/sbin/ldconfig && export LD_LIBRARY_PATH=/usr/local/lib:LD_LIBRARY_PATH
./configure
[ $? -eq 0 ] && : || (echo "configure mcrypt error";exit 2)
make && make install
php部分
cd $path
[ -f php-5.6.15.tar.gz ] && : || wget http://cn2.php.net/distributions/php- 5.6.15.tar.gz
\rm -rf $path/php-5.6.15 && tar zxf php-5.6.15.tar.gz && cd php-5.6.15
./configure \
--prefix=/usr/local/php-5.6.15 \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-ftp \
--enable-opcache=yes
[ $? -eq 0 ] && : || (echo "configure php error";exit 2)
make && make install
cd $path/php-5.6.15
ln -sf /usr/local/php-5.6.15 /usr/local/php
\cp $path/php-5.6.15/php.ini-production /usr/local/php/lib/php.ini
\cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
网友评论