Browse Source

Change curl install dir

lj2007331@gmail.com 7 years ago
parent
commit
c4ca2d71d2
14 changed files with 374 additions and 317 deletions
  1. 7 7
      addons.sh
  2. 2 2
      include/GraphicsMagick.sh
  3. 2 2
      include/ImageMagick.sh
  4. 53 45
      include/php-5.3.sh
  5. 52 44
      include/php-5.4.sh
  6. 51 43
      include/php-5.5.sh
  7. 51 43
      include/php-5.6.sh
  8. 52 44
      include/php-7.0.sh
  9. 52 44
      include/php-7.1.sh
  10. 38 32
      include/php-7.2.sh
  11. 2 2
      install.sh
  12. 3 0
      options.conf
  13. 4 4
      uninstall.sh
  14. 5 5
      versions.txt

+ 7 - 7
addons.sh

@@ -322,18 +322,18 @@ What Are You Doing?
           Check_PHP_Extension
           magick_yn=y && checkDownload
           if [ "${magick_option}" = '1' ]; then
-            [ ! -d "/usr/local/imagemagick" ] && Install_ImageMagick
+            [ ! -d "${imagick_install_dir}" ] && Install_ImageMagick
             Install_php-imagick
             Check_succ
           elif [ "${magick_option}" = '2' ]; then
-            [ ! -d "/usr/local/graphicsmagick" ] && Install_GraphicsMagick
+            [ ! -d "${gmagick_install_dir}" ] && Install_GraphicsMagick
             Install_php-gmagick
             Check_succ
           fi
         else
           Uninstall_succ
-          [ -d "/usr/local/imagemagick" ] && rm -rf /usr/local/imagemagick
-          [ -d "/usr/local/graphicsmagick" ] && rm -rf /usr/local/graphicsmagick
+          [ -d "${imagick_install_dir}" ] && rm -rf ${imagick_install_dir}
+          [ -d "${gmagick_install_dir}" ] && rm -rf ${gmagick_install_dir}
         fi
         ;;
       4)
@@ -427,9 +427,9 @@ What Are You Doing?
             tar xzf swoole-${swoole_ver}.tgz
             pushd swoole-${swoole_ver}
           else
-            src_url=https://pecl.php.net/get/swoole-1.10.1.tgz && Download_src
-            tar xzf swoole-1.10.1.tgz
-            pushd swoole-1.10.1
+            src_url=https://pecl.php.net/get/swoole-1.10.2.tgz && Download_src
+            tar xzf swoole-1.10.2.tgz
+            pushd swoole-1.10.2
           fi
           ${php_install_dir}/bin/phpize
           ./configure --with-php-config=${php_install_dir}/bin/php-config

+ 2 - 2
include/GraphicsMagick.sh

@@ -12,7 +12,7 @@ Install_GraphicsMagick() {
   pushd ${oneinstack_dir}/src > /dev/null
   tar xzf GraphicsMagick-${graphicsmagick_ver}.tar.gz
   pushd GraphicsMagick-${graphicsmagick_ver}
-  ./configure --prefix=/usr/local/graphicsmagick --enable-shared --enable-static
+  ./configure --prefix=${gmagick_install_dir} --enable-shared --enable-static
   make -j ${THREAD} && make install
   popd
   rm -rf GraphicsMagick-${graphicsmagick_ver}
@@ -32,7 +32,7 @@ Install_php-gmagick() {
     fi
     export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
     ${php_install_dir}/bin/phpize
-    ./configure --with-php-config=${php_install_dir}/bin/php-config --with-gmagick=/usr/local/graphicsmagick
+    ./configure --with-php-config=${php_install_dir}/bin/php-config --with-gmagick=${gmagick_install_dir}
     make -j ${THREAD} && make install
     popd
     if [ -f "${phpExtensionDir}/gmagick.so" ]; then

+ 2 - 2
include/ImageMagick.sh

@@ -12,7 +12,7 @@ Install_ImageMagick() {
   pushd ${oneinstack_dir}/src > /dev/null
   tar xzf ImageMagick-${imagemagick_ver}.tar.gz
   pushd ImageMagick-${imagemagick_ver}
-  ./configure --prefix=/usr/local/imagemagick --enable-shared --enable-static
+  ./configure --prefix=${imagick_install_dir} --enable-shared --enable-static
   make -j ${THREAD} && make install
   popd
   rm -rf ImageMagick-${imagemagick_ver}
@@ -27,7 +27,7 @@ Install_php-imagick() {
     pushd imagick-${imagick_ver}
     export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
     ${php_install_dir}/bin/phpize
-    ./configure --with-php-config=${php_install_dir}/bin/php-config --with-imagick=/usr/local/imagemagick
+    ./configure --with-php-config=${php_install_dir}/bin/php-config --with-imagick=${imagick_install_dir}
     make -j ${THREAD} && make install
     popd
     if [ -f "${phpExtensionDir}/imagick.so" ]; then

+ 53 - 45
include/php-5.3.sh

@@ -10,56 +10,64 @@
 
 Install_PHP53() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+    tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
+    pushd libmcrypt-${libmcrypt_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    ldconfig
+    pushd libltdl
+    ./configure --enable-ltdl-install
+    make -j ${THREAD} && make install
+    popd;popd
+    rm -rf libmcrypt-${libmcrypt_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
 
-  tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
-  pushd libmcrypt-${libmcrypt_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  ldconfig
-  pushd libltdl
-  ./configure --enable-ltdl-install
-  make -j ${THREAD} && make install
-  popd;popd 
-  rm -rf libmcrypt-${libmcrypt_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd 
-  rm -rf mhash-${mhash_ver}
-  
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   [ ! -e '/usr/include/freetype2/freetype' ] &&  ln -s /usr/include/freetype2 /usr/include/freetype2/freetype
-  
+
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver
   ldconfig
   ./configure
   make -j ${THREAD} && make install
-  popd 
+  popd
   rm -rf mcrypt-$mcrypt_ver
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
-  
+
   tar xzf php-${php53_ver}.tar.gz
   patch -d php-${php53_ver} -p0 < fpm-race-condition.patch
   pushd php-${php53_ver}
@@ -74,7 +82,7 @@ Install_PHP53() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -85,7 +93,7 @@ Install_PHP53() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -93,7 +101,7 @@ Install_PHP53() {
   sed -i '/^BUILD_/ s/\$(CC)/\$(CXX)/g' Makefile
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -101,17 +109,17 @@ Install_PHP53() {
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
     kill -9 $$
   fi
-  
+
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -124,7 +132,7 @@ Install_PHP53() {
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   if [[ ! ${apache_option} =~ ^[1-2]$ ]] && [ ! -e "${apache_install_dir}/bin/apxs" ]; then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

+ 52 - 44
include/php-5.4.sh

@@ -10,43 +10,51 @@
 
 Install_PHP54() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
-  
-  tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
-  pushd libmcrypt-${libmcrypt_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  ldconfig
-  pushd libltdl
-  ./configure --enable-ltdl-install
-  make -j ${THREAD} && make install
-  popd;popd
-  rm -rf libmcrypt-${libmcrypt_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd 
-  rm -rf mhash-${mhash_ver}
-  
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+    tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
+    pushd libmcrypt-${libmcrypt_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    ldconfig
+    pushd libltdl
+    ./configure --enable-ltdl-install
+    make -j ${THREAD} && make install
+    popd;popd
+    rm -rf libmcrypt-${libmcrypt_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
+
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver
   ldconfig
@@ -54,10 +62,10 @@ Install_PHP54() {
   make -j ${THREAD} && make install
   popd
   rm -rf mcrypt-$mcrypt_ver
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
-  
+
   tar xzf php-${php54_ver}.tar.gz
   patch -d php-${php54_ver} -p0 < fpm-race-condition.patch
   pushd php-${php54_ver}
@@ -70,7 +78,7 @@ Install_PHP54() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -81,14 +89,14 @@ Install_PHP54() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -96,17 +104,17 @@ Install_PHP54() {
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
     kill -9 $$
   fi
-  
+
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -119,7 +127,7 @@ Install_PHP54() {
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   if [[ ! ${apache_option} =~ ^[1-2]$ ]] && [ ! -e "${apache_install_dir}/bin/apxs" ]; then
     # php-fpm Init Script
     /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

+ 51 - 43
include/php-5.5.sh

@@ -10,43 +10,51 @@
 
 Install_PHP55() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
-  
-  tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
-  pushd libmcrypt-${libmcrypt_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  ldconfig
-  pushd libltdl
-  ./configure --enable-ltdl-install
-  make -j ${THREAD} && make install
-  popd;popd
-  rm -rf libmcrypt-${libmcrypt_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd
-  rm -rf mhash-${mhash_ver}
-  
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+    tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
+    pushd libmcrypt-${libmcrypt_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    ldconfig
+    pushd libltdl
+    ./configure --enable-ltdl-install
+    make -j ${THREAD} && make install
+    popd;popd
+    rm -rf libmcrypt-${libmcrypt_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
+
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver
   ldconfig
@@ -54,7 +62,7 @@ Install_PHP55() {
   make -j ${THREAD} && make install
   popd
   rm -rf mcrypt-$mcrypt_ver
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
   tar xzf php-${php55_ver}.tar.gz
@@ -69,7 +77,7 @@ Install_PHP55() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -80,14 +88,14 @@ Install_PHP55() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -95,17 +103,17 @@ Install_PHP55() {
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
     kill -9 $$
   fi
-  
+
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -118,7 +126,7 @@ Install_PHP55() {
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so

+ 51 - 43
include/php-5.6.sh

@@ -10,43 +10,51 @@
 
 Install_PHP56() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
-  
-  tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
-  pushd libmcrypt-${libmcrypt_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  ldconfig
-  pushd libltdl
-  ./configure --enable-ltdl-install
-  make -j ${THREAD} && make install
-  popd;popd
-  rm -rf libmcrypt-${libmcrypt_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd
-  rm -rf mhash-${mhash_ver}
-  
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+    tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
+    pushd libmcrypt-${libmcrypt_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    ldconfig
+    pushd libltdl
+    ./configure --enable-ltdl-install
+    make -j ${THREAD} && make install
+    popd;popd
+    rm -rf libmcrypt-${libmcrypt_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
+
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver
   ldconfig
@@ -54,10 +62,10 @@ Install_PHP56() {
   make -j ${THREAD} && make install
   popd
   rm -rf mcrypt-$mcrypt_ver
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
-  
+
   tar xzf php-${php56_ver}.tar.gz
   pushd php-${php56_ver}
   make clean
@@ -70,7 +78,7 @@ Install_PHP56() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -81,14 +89,14 @@ Install_PHP56() {
     --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -100,13 +108,13 @@ Install_PHP56() {
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -119,7 +127,7 @@ Install_PHP56() {
   sed -i 's@^max_execution_time.*@max_execution_time = 5@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so

+ 52 - 44
include/php-7.0.sh

@@ -10,43 +10,51 @@
 
 Install_PHP70() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
-  
-  tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
-  pushd libmcrypt-${libmcrypt_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  ldconfig
-  pushd libltdl
-  ./configure --enable-ltdl-install
-  make -j ${THREAD} && make install
-  popd;popd
-  rm -rf libmcrypt-${libmcrypt_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd
-  rm -rf mhash-${mhash_ver}
-  
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+    tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
+    pushd libmcrypt-${libmcrypt_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    ldconfig
+    pushd libltdl
+    ./configure --enable-ltdl-install
+    make -j ${THREAD} && make install
+    popd;popd
+    rm -rf libmcrypt-${libmcrypt_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
+
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver
   ldconfig
@@ -54,10 +62,10 @@ Install_PHP70() {
   make -j ${THREAD} && make install
   popd
   rm -rf mcrypt-$mcrypt_ver
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
-  
+
   tar xzf php-${php70_ver}.tar.gz
   pushd php-${php70_ver}
   make clean
@@ -71,7 +79,7 @@ Install_PHP70() {
     --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -82,14 +90,14 @@ Install_PHP70() {
     --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -97,17 +105,17 @@ Install_PHP70() {
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
     kill -9 $$
   fi
-  
+
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -121,7 +129,7 @@ Install_PHP70() {
   sed -i 's@^;realpath_cache_size.*@realpath_cache_size = 2M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so

+ 52 - 44
include/php-7.1.sh

@@ -10,43 +10,51 @@
 
 Install_PHP71() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
-  
-  tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
-  pushd libmcrypt-${libmcrypt_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  ldconfig
-  pushd libltdl
-  ./configure --enable-ltdl-install
-  make -j ${THREAD} && make install
-  popd;popd
-  rm -rf libmcrypt-${libmcrypt_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd
-  rm -rf mhash-${mhash_ver}
-  
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+    tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
+    pushd libmcrypt-${libmcrypt_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    ldconfig
+    pushd libltdl
+    ./configure --enable-ltdl-install
+    make -j ${THREAD} && make install
+    popd;popd
+    rm -rf libmcrypt-${libmcrypt_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
+
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   tar xzf mcrypt-$mcrypt_ver.tar.gz
   pushd mcrypt-$mcrypt_ver
   ldconfig
@@ -54,10 +62,10 @@ Install_PHP71() {
   make -j ${THREAD} && make install
   popd
   rm -rf mcrypt-$mcrypt_ver
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
-  
+
   tar xzf php-${php71_ver}.tar.gz
   pushd php-${php71_ver}
   make clean
@@ -71,7 +79,7 @@ Install_PHP71() {
     --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -82,14 +90,14 @@ Install_PHP71() {
     --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -97,17 +105,17 @@ Install_PHP71() {
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
     kill -9 $$
   fi
-  
+
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -121,7 +129,7 @@ Install_PHP71() {
   sed -i 's@^;realpath_cache_size.*@realpath_cache_size = 2M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so

+ 38 - 32
include/php-7.2.sh

@@ -10,35 +10,41 @@
 
 Install_PHP72() {
   pushd ${oneinstack_dir}/src > /dev/null
-  tar xzf libiconv-${libiconv_ver}.tar.gz
-  patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
-  pushd libiconv-${libiconv_ver}
-  ./configure --prefix=/usr/local
-  make -j ${THREAD} && make install
-  popd
-  rm -rf libiconv-${libiconv_ver}
-  
-  tar xzf curl-${curl_ver}.tar.gz
-  pushd curl-${curl_ver}
-  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
-  make -j ${THREAD} && make install
-  popd
-  rm -rf curl-${curl_ver}
-  
-  tar xzf mhash-${mhash_ver}.tar.gz
-  pushd mhash-${mhash_ver}
-  ./configure
-  make -j ${THREAD} && make install
-  popd
-  rm -rf mhash-${mhash_ver}
-  
+  if [ ! -e "/usr/local/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    patch -d libiconv-${libiconv_ver} -p0 < libiconv-glibc-2.16.patch
+    pushd libiconv-${libiconv_ver}
+    ./configure --prefix=/usr/local
+    make -j ${THREAD} && make install
+    popd
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver}
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    popd
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver}
+    ./configure
+    make -j ${THREAD} && make install
+    popd
+    rm -rf mhash-${mhash_ver}
+  fi
+
   echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
-  
+
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
-  
+
   tar xzf php-${php72_ver}.tar.gz
   pushd php-${php72_ver}
   make clean
@@ -52,7 +58,7 @@ Install_PHP72() {
     --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-gd --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
@@ -63,14 +69,14 @@ Install_PHP72() {
     --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
     --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
     --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
-    --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local --enable-mbregex \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
     --enable-mbstring --with-gd --with-openssl=${openssl_install_dir} \
     --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
     --with-gettext --enable-zip --enable-soap --disable-debug $php_modules_options
   fi
   make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
   make install
-  
+
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
@@ -78,17 +84,17 @@ Install_PHP72() {
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
     kill -9 $$
   fi
-  
+
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  
+
   # wget -c http://pear.php.net/go-pear.phar
   # ${php_install_dir}/bin/php go-pear.phar
-  
+
   [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
   /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
-  
+
   sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
   sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
   sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
@@ -102,7 +108,7 @@ Install_PHP72() {
   sed -i 's@^;realpath_cache_size.*@realpath_cache_size = 2M@' ${php_install_dir}/etc/php.ini
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
-  
+
   [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so

+ 2 - 2
install.sh

@@ -825,11 +825,11 @@ fi
 # ImageMagick or GraphicsMagick
 if [ "${magick_option}" == '1' ]; then
   . include/ImageMagick.sh
-  [ ! -d "/usr/local/imagemagick" ] && Install_ImageMagick 2>&1 | tee -a ${oneinstack_dir}/install.log
+  [ ! -d "${imagick_install_dir}" ] && Install_ImageMagick 2>&1 | tee -a ${oneinstack_dir}/install.log
   [ ! -e "`${php_install_dir}/bin/php-config --extension-dir`/imagick.so" ] && Install_php-imagick 2>&1 | tee -a ${oneinstack_dir}/install.log
 elif [ "${magick_option}" == '2' ]; then
   . include/GraphicsMagick.sh
-  [ ! -d "/usr/local/graphicsmagick" ] && Install_GraphicsMagick 2>&1 | tee -a ${oneinstack_dir}/install.log
+  [ ! -d "${gmagick_install_dir}" ] && Install_GraphicsMagick 2>&1 | tee -a ${oneinstack_dir}/install.log
   [ ! -e "`${php_install_dir}/bin/php-config --extension-dir`/gmagick.so" ] && Install_php-gmagick 2>&1 | tee -a ${oneinstack_dir}/install.log
 fi
 

+ 3 - 0
options.conf

@@ -26,6 +26,9 @@ redis_install_dir=/usr/local/redis
 python_install_dir=/usr/local/python
 
 openssl_install_dir=/usr/local/openssl
+imagick_install_dir=/usr/local/imagemagick
+gmagick_install_dir=/usr/local/graphicsmagick
+curl_install_dir=/usr/local/curl
 
 # Add modules
 nginx_modules_options=''

+ 4 - 4
uninstall.sh

@@ -161,15 +161,15 @@ Uninstall_MongoDB() {
 Print_PHP() {
   [ -e "${php_install_dir}" ] && echo "${php_install_dir}"
   [ -e "/etc/init.d/php-fpm" ] && echo "/etc/init.d/php-fpm"
-  [ -e "/usr/local/imagemagick" ] && echo "/usr/local/imagemagick"
-  [ -e "/usr/local/graphicsmagick" ] && echo '/usr/local/graphicsmagick'
+  [ -e "${imagick_install_dir}" ] && echo "${imagick_install_dir}"
+  [ -e "${gmagick_install_dir}" ] && echo "${gmagick_install_dir}"
 }
 
 Uninstall_PHP() {
   [ -e "${php_install_dir}/bin/phpize" -a -e "${php_install_dir}/etc/php-fpm.conf" ] && { service php-fpm stop > /dev/null 2>&1; rm -rf ${php_install_dir} /etc/init.d/php-fpm; }
   [ -e "${php_install_dir}/bin/phpize" -a ! -e "${php_install_dir}/etc/php-fpm.conf" ] && rm -rf ${php_install_dir}
-  [ -e "/usr/local/imagemagick" ] && rm -rf /usr/local/imagemagick
-  [ -e "/usr/local/graphicsmagick" ] && rm -rf /usr/local/graphicsmagick
+  [ -e "${imagick_install_dir}" ] && rm -rf ${imagick_install_dir}
+  [ -e "${gmagick_install_dir}" ] && rm -rf ${gmagick_install_dir}
   sed -i "s@${php_install_dir}/bin:@@" /etc/profile
   echo "${CMSG}PHP uninstall completed! ${CEND}"
 }

+ 5 - 5
versions.txt

@@ -11,10 +11,10 @@ tomcat6_ver=6.0.53
 
 apache24_ver=2.4.33
 apache22_ver=2.2.34
-pcre_ver=8.41
+pcre_ver=8.42
 apr_ver=1.6.3
 apr_util_ver=1.6.1
-nghttp2_ver=1.30.0
+nghttp2_ver=1.31.0
 
 # DB
 mysql57_ver=5.7.21
@@ -55,7 +55,7 @@ curl_ver=7.59.0
 libmcrypt_ver=2.5.8
 mcrypt_ver=2.6.8
 mhash_ver=0.9.9.9
-imagemagick_ver=6.9.9-39
+imagemagick_ver=6.9.9-40
 imagick_ver=3.4.3
 graphicsmagick_ver=1.3.28
 gmagick_for_php7_ver=2.0.5RC1
@@ -63,7 +63,7 @@ gmagick_ver=1.1.7RC3
 zendopcache_ver=7.0.5
 xcache_ver=3.2.0
 apcu_ver=4.0.11
-apcu_for_php7_ver=5.1.10
+apcu_for_php7_ver=5.1.11
 eaccelerator_ver=0.9.6.1
 swoole_ver=2.1.1
 xdebug_ver=2.6.0
@@ -72,7 +72,7 @@ xdebug_ver=2.6.0
 pureftpd_ver=1.0.47
 
 # Redis
-redis_ver=4.0.8
+redis_ver=4.0.9
 redis_pecl_ver=4.0.0
 
 # Memcached