lj2007331@gmail.com 7 rokov pred
rodič
commit
f7c7796286
9 zmenil súbory, kde vykonal 297 pridanie a 42 odobranie
  1. 2 2
      README.md
  2. 7 7
      addons.sh
  3. 2 2
      backup_setup.sh
  4. 6 3
      include/check_download.sh
  5. 245 0
      include/php-7.2.sh
  6. 25 19
      install.sh
  7. 1 1
      ss.sh
  8. 5 4
      versions.txt
  9. 4 4
      vhost.sh

+ 2 - 2
README.md

@@ -1,13 +1,13 @@
 [![PayPal donate button](https://img.shields.io/badge/paypal-donate-green.svg)](https://paypal.me/yeho) [![支付宝捐助按钮](https://img.shields.io/badge/%E6%94%AF%E4%BB%98%E5%AE%9D-%E5%90%91TA%E6%8D%90%E5%8A%A9-green.svg)](https://static.oneinstack.com/images/alipay.png) [![微信捐助按钮](https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-%E5%90%91TA%E6%8D%90%E5%8A%A9-green.svg)](https://static.oneinstack.com/images/weixin.png)
 
-This script is written using the shell, in order to quickly deploy `LEMP`/`LAMP`/`LNMP`/`LNMPA`/`LTMP`(Linux, Nginx/Tengine/OpenResty, MySQL in a production environment/MariaDB/Percona, PHP, JAVA), applicable to CentOS 5~7(including redhat), Debian 6~8, Ubuntu 12~16 of 32 and 64.
+This script is written using the shell, in order to quickly deploy `LEMP`/`LAMP`/`LNMP`/`LNMPA`/`LTMP`(Linux, Nginx/Tengine/OpenResty, MySQL in a production environment/MariaDB/Percona, PHP, JAVA), applicable to CentOS 6~7(including redhat), Debian 6~9, Ubuntu 12~16 of 32 and 64.
 
 Script properties:
 - Continually updated
 - Source compiler installation, most stable source is the latest version, and download from the official site
 - Some security optimization
 - Providing a plurality of database versions (MySQL-5.7, MySQL-5.6, MySQL-5.5, MariaDB-10.1, MariaDB-10.0, MariaDB-5.5, Percona-5.7, Percona-5.6, Percona-5.5, AliSQL-5.6)
-- Providing multiple PHP versions (PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
+- Providing multiple PHP versions (PHP-7.2, PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
 - Provide Nginx, Tengine, OpenResty
 - Providing a plurality of Tomcat version (Tomcat-8, Tomcat-7, Tomcat-6)
 - Providing a plurality of JDK version (JDK-1.8, JDK-1.7, JDK-1.6)

+ 7 - 7
addons.sh

@@ -69,7 +69,7 @@ if [ -e "${php_install_dir}/bin/phpize" ]; then
     "5.6")
       PHP_version=4
       ;;
-    "7.0" | "7.1")
+    "7.0" | "7.1" | "7.2" )
       PHP_version=5
       ;;
     *)
@@ -192,7 +192,7 @@ ACTION_FUN() {
     read -p "Please input a number:(Default 1 press Enter) " ACTION
     [ -z "${ACTION}" ] && ACTION=1
     if [[ ! "${ACTION}" =~ ^[1,2]$ ]]; then
-      echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+      echo "${CWARNING}input error! Please only input number 1~2${CEND}"
     else
       break
     fi
@@ -229,7 +229,7 @@ What Are You Doing?
           read -p "Please input a number:(Default 1 press Enter) " PHP_cache
           [ -z "${PHP_cache}" ] && PHP_cache=1
           if [[ ! "${PHP_cache}" =~ ^[1-4]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1,2,3,4${CEND}"
+            echo "${CWARNING}input error! Please only input number 1~4${CEND}"
           else
             case "${PHP_cache}" in
               1)
@@ -312,7 +312,7 @@ What Are You Doing?
           read -p "Please input a number:(Default 1 press Enter) " Loader
           [ -z "${Loader}" ] && Loader=1
           if [[ ! "${Loader}" =~ ^[1,2]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+            echo "${CWARNING}input error! Please only input number 1~2${CEND}"
           else
             [ "${Loader}" = '1' ] && PHP_extension=ZendGuardLoader
             [ "${Loader}" = '2' ] && PHP_extension=0ioncube
@@ -334,7 +334,7 @@ What Are You Doing?
               echo; echo "${CWARNING}Your php ${PHP_detail_version} or platform ${TARGET_ARCH} does not support ${PHP_extension}! ${CEND}";
             fi
           elif [ "${Loader}" = '2' ]; then
-            if [[ "${PHP_main_version}" =~ ^5.[3-6]$|^7.0$ ]] || [ "${TARGET_ARCH}" != "arm64" ]; then
+            if [[ "${PHP_main_version}" =~ ^5.[3-6]$|^7.[0-1]$ ]] || [ "${TARGET_ARCH}" != "arm64" ]; then
               ionCube_yn='y' && checkDownload
               Install_ionCube
               Restart_PHP; echo "${CSUCCESS}PHP ioncube module installed successfully! ${CEND}";
@@ -355,7 +355,7 @@ What Are You Doing?
           read -p "Please input a number:(Default 1 press Enter) " Magick
           [ -z "${Magick}" ] && Magick=1
           if [[ ! "${Magick}" =~ ^[1,2]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+            echo "${CWARNING}input error! Please only input number 1~2${CEND}"
           else
             [ "${Magick}" = '1' ] && PHP_extension=imagick
             [ "${Magick}" = '2' ] && PHP_extension=gmagick
@@ -410,7 +410,7 @@ What Are You Doing?
           read -p "Please input a number:(Default 1 press Enter) " Memcache
           [ -z "${Memcache}" ] && Memcache=1
           if [[ ! "${Memcache}" =~ ^[1-3]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+            echo "${CWARNING}input error! Please only input number 1~3${CEND}"
           else
             [ "${Memcache}" = '1' ] && PHP_extension=memcache
             [ "${Memcache}" = '2' ] && PHP_extension=memcached

+ 2 - 2
backup_setup.sh

@@ -41,7 +41,7 @@ while :; do echo
   read -p "Please input a number:(Default 1 press Enter) " DESC_BK
   [ -z "$DESC_BK" ] && DESC_BK=1
   if [[ ! $DESC_BK =~ ^[1-6]$ ]]; then
-    echo "${CWARNING}input error! Please only input number 1,2,3,4,5,6${CEND}"
+    echo "${CWARNING}input error! Please only input number 1~6${CEND}"
   else
     break
   fi
@@ -62,7 +62,7 @@ while :; do echo
   read -p "Please input a number:(Default 1 press Enter) " CONTENT_BK
   [ -z "$CONTENT_BK" ] && CONTENT_BK=1
   if [[ ! $CONTENT_BK =~ ^[1-3]$ ]]; then
-    echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+    echo "${CWARNING}input error! Please only input number 1~3${CEND}"
   else
     break
   fi

+ 6 - 3
include/check_download.sh

@@ -559,6 +559,9 @@ checkDownload() {
       6)
         src_url=http://www.php.net/distributions/php-${php71_version}.tar.gz && Download_src
         ;;
+      7)
+        src_url=http://www.php.net/distributions/php-${php72_version}.tar.gz && Download_src
+        ;;
     esac
   fi
 
@@ -579,7 +582,7 @@ checkDownload() {
       fi
       ;;
     3)
-      # php 5.3 5.4 5.5 5.6 7.0 7.1
+      # php 5.3 5.4 5.5 5.6 7.0 7.1 7.2
       echo "Download apcu..."
       if [[ "$PHP_version" =~ ^[1-4]$ ]]; then
         src_url=http://pecl.php.net/get/apcu-${apcu_version}.tgz && Download_src
@@ -671,7 +674,7 @@ checkDownload() {
     else
       echo "Download graphicsmagick..."
       src_url=http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/${GraphicsMagick_version}/GraphicsMagick-${GraphicsMagick_version}.tar.gz && Download_src
-      if [[ "$PHP_version" =~ ^[5-6]$ ]]; then
+      if [[ "$PHP_version" =~ ^[5-7]$ ]]; then
         echo "Download gmagick for php 7.x..."
         src_url=https://pecl.php.net/get/gmagick-${gmagick_for_php7_version}.tgz && Download_src
       else
@@ -705,7 +708,7 @@ checkDownload() {
   if [ "${memcached_yn}" == 'y' ]; then
     echo "Download memcached..."
     src_url=http://www.memcached.org/files/memcached-${memcached_version}.tar.gz && Download_src
-    if [[ "$PHP_version" =~ ^[5-6]$ ]]; then
+    if [[ "$PHP_version" =~ ^[5-7]$ ]]; then
       echo "Download pecl memcache for php 7.x..."
       # src_url=https://codeload.github.com/websupport-sk/pecl-memcache/zip/php7 && Download_src
       src_url=${mirrorLink}/pecl-memcache-php7.tgz && Download_src

+ 245 - 0
include/php-7.2.sh

@@ -0,0 +1,245 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://blog.linuxeye.com
+#
+# Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/lj2007331/oneinstack
+
+Install_PHP72() {
+  pushd ${oneinstack_dir}/src
+  
+  tar xzf libiconv-$libiconv_version.tar.gz
+  patch -d libiconv-$libiconv_version -p0 < libiconv-glibc-2.16.patch
+  pushd libiconv-$libiconv_version
+  ./configure --prefix=/usr/local
+  make -j ${THREAD} && make install
+  popd
+  rm -rf libiconv-$libiconv_version
+  
+  tar xzf curl-$curl_version.tar.gz
+  pushd curl-$curl_version
+  ./configure --prefix=/usr/local --with-ssl=${openssl_install_dir}
+  make -j ${THREAD} && make install
+  popd
+  rm -rf curl-$curl_version
+  
+  tar xzf libmcrypt-$libmcrypt_version.tar.gz
+  pushd libmcrypt-$libmcrypt_version
+  ./configure
+  make -j ${THREAD} && make install
+  ldconfig
+  pushd libltdl
+  ./configure --enable-ltdl-install
+  make -j ${THREAD} && make install
+  popd;popd
+  rm -rf libmcrypt-$libmcrypt_version
+  
+  tar xzf mhash-$mhash_version.tar.gz
+  pushd mhash-$mhash_version
+  ./configure
+  make -j ${THREAD} && make install
+  popd
+  rm -rf mhash-$mhash_version
+  
+  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_version.tar.gz
+  pushd mcrypt-$mcrypt_version
+  ldconfig
+  ./configure
+  make -j ${THREAD} && make install
+  popd
+  rm -rf mcrypt-$mcrypt_version
+  
+  id -u $run_user >/dev/null 2>&1
+  [ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user
+  
+  tar xzf php-$php72_version.tar.gz
+  pushd php-$php72_version
+  make clean
+  ./buildconf
+  [ ! -d "$php_install_dir" ] && mkdir -p $php_install_dir
+  [ "$PHP_cache" == '1' ] && PHP_cache_tmp='--enable-opcache' || PHP_cache_tmp='--disable-opcache'
+  if [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ]; then
+    ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+    --with-config-file-scan-dir=$php_install_dir/etc/php.d \
+    --with-apxs2=$apache_install_dir/bin/apxs $PHP_cache_tmp --disable-fileinfo \
+    --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-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
+  else
+    ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
+    --with-config-file-scan-dir=$php_install_dir/etc/php.d \
+    --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm $PHP_cache_tmp --disable-fileinfo \
+    --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-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
+    rm -rf $php_install_dir
+    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
+  sed -i 's@^short_open_tag = Off@short_open_tag = On@' $php_install_dir/etc/php.ini
+  sed -i 's@^expose_php = On@expose_php = Off@' $php_install_dir/etc/php.ini
+  sed -i 's@^request_order.*@request_order = "CGP"@' $php_install_dir/etc/php.ini
+  sed -i 's@^;date.timezone.*@date.timezone = Asia/Shanghai@' $php_install_dir/etc/php.ini
+  sed -i 's@^post_max_size.*@post_max_size = 100M@' $php_install_dir/etc/php.ini
+  sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' $php_install_dir/etc/php.ini
+  sed -i 's@^max_execution_time.*@max_execution_time = 600@' $php_install_dir/etc/php.ini
+  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
+  
+  [ "$PHP_cache" == '1' ] && cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
+[opcache]
+zend_extension=opcache.so
+opcache.enable=1
+opcache.enable_cli=1
+opcache.memory_consumption=$Memory_limit
+opcache.interned_strings_buffer=8
+opcache.max_accelerated_files=100000
+opcache.max_wasted_percentage=5
+opcache.use_cwd=1
+opcache.validate_timestamps=1
+opcache.revalidate_freq=60
+opcache.save_comments=0
+opcache.fast_shutdown=1
+opcache.consistency_checks=0
+;opcache.optimization_level=0
+EOF
+
+  if [[ ! $Apache_version =~ ^[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
+    chmod +x /etc/init.d/php-fpm
+    [ "$OS" == 'CentOS' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
+    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && update-rc.d php-fpm defaults
+
+    cat > $php_install_dir/etc/php-fpm.conf <<EOF
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+pid = run/php-fpm.pid
+error_log = log/php-fpm.log
+log_level = warning
+
+emergency_restart_threshold = 30
+emergency_restart_interval = 60s
+process_control_timeout = 5s
+daemonize = yes
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ;
+;;;;;;;;;;;;;;;;;;;;
+
+[$run_user]
+listen = /dev/shm/php-cgi.sock
+listen.backlog = -1
+listen.allowed_clients = 127.0.0.1
+listen.owner = $run_user
+listen.group = $run_user
+listen.mode = 0666
+user = $run_user
+group = $run_user
+
+pm = dynamic
+pm.max_children = 12
+pm.start_servers = 8
+pm.min_spare_servers = 6
+pm.max_spare_servers = 12
+pm.max_requests = 2048
+pm.process_idle_timeout = 10s
+request_terminate_timeout = 120
+request_slowlog_timeout = 0
+
+pm.status_path = /php-fpm_status
+slowlog = log/slow.log
+rlimit_files = 51200
+rlimit_core = 0
+
+catch_workers_output = yes
+;env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
+EOF
+
+    [ -d "/run/shm" -a ! -e "/dev/shm" ] && sed -i 's@/dev/shm@/run/shm@' $php_install_dir/etc/php-fpm.conf $oneinstack_dir/vhost.sh $oneinstack_dir/config/nginx.conf
+
+    if [ $Mem -le 3000 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = $(($Mem/3/30))@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = $(($Mem/3/40))@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = $(($Mem/3/20))@" $php_install_dir/etc/php-fpm.conf
+    elif [ $Mem -gt 3000 -a $Mem -le 4500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 50@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 30@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 20@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 50@" $php_install_dir/etc/php-fpm.conf
+    elif [ $Mem -gt 4500 -a $Mem -le 6500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 60@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 40@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 30@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 60@" $php_install_dir/etc/php-fpm.conf
+    elif [ $Mem -gt 6500 -a $Mem -le 8500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 70@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 50@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 40@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 70@" $php_install_dir/etc/php-fpm.conf
+    elif [ $Mem -gt 8500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 80@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 60@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 50@" $php_install_dir/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" $php_install_dir/etc/php-fpm.conf
+    fi
+
+    #[ "$Web_yn" == 'n' ] && sed -i "s@^listen =.*@listen = $IPADDR:9000@" $php_install_dir/etc/php-fpm.conf
+    service php-fpm start
+
+  elif [[ $Apache_version =~ ^[1-2]$ ]] || [ -e "$apache_install_dir/bin/apxs" ]; then
+    service httpd restart
+  fi
+  popd
+  [ -e "$php_install_dir/bin/phpize" ] && rm -rf php-$php72_version
+  popd
+}

+ 25 - 19
install.sh

@@ -81,7 +81,7 @@ while :; do echo
         read -p "Please input a number:(Default 1 press Enter) " Nginx_version
         [ -z "$Nginx_version" ] && Nginx_version=1
         if [[ ! $Nginx_version =~ ^[1-4]$ ]]; then
-          echo "${CWARNING}input error! Please only input number 1,2,3,4${CEND}"
+          echo "${CWARNING}input error! Please only input number 1~4${CEND}"
         else
           [ "$Nginx_version" != '4' -a -e "$nginx_install_dir/sbin/nginx" ] && { echo "${CWARNING}Nginx already installed! ${CEND}"; Nginx_version=Other; }
           [ "$Nginx_version" != '4' -a -e "$tengine_install_dir/sbin/nginx" ] && { echo "${CWARNING}Tengine already installed! ${CEND}"; Nginx_version=Other; }
@@ -98,7 +98,7 @@ while :; do echo
         read -p "Please input a number:(Default 3 press Enter) " Apache_version
         [ -z "$Apache_version" ] && Apache_version=3
         if [[ ! $Apache_version =~ ^[1-3]$ ]]; then
-          echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+          echo "${CWARNING}input error! Please only input number 1~3${CEND}"
         else
           [ "$Apache_version" != '3' -a -e "$apache_install_dir/conf/httpd.conf" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; Apache_version=Other; }
           break
@@ -114,7 +114,7 @@ while :; do echo
         read -p "Please input a number:(Default 4 press Enter) " Tomcat_version
         [ -z "$Tomcat_version" ] && Tomcat_version=4
         if [[ ! $Tomcat_version =~ ^[1-4]$ ]]; then
-          echo "${CWARNING}input error! Please only input number 1,2,3,4${CEND}"
+          echo "${CWARNING}input error! Please only input number 1~4${CEND}"
         else
           [ "$Tomcat_version" != '4' -a -e "$tomcat_install_dir/conf/server.xml" ] && { echo "${CWARNING}Tomcat already installed! ${CEND}" ; Tomcat_version=Other; }
           if [ "$Tomcat_version" == '1' ]; then
@@ -125,7 +125,7 @@ while :; do echo
               read -p "Please input a number:(Default 2 press Enter) " JDK_version
               [ -z "$JDK_version" ] && JDK_version=2
               if [[ ! $JDK_version =~ ^[1-2]$ ]]; then
-                echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+                echo "${CWARNING}input error! Please only input number 1~2${CEND}"
               else
                 break
               fi
@@ -139,7 +139,7 @@ while :; do echo
               read -p "Please input a number:(Default 2 press Enter) " JDK_version
               [ -z "$JDK_version" ] && JDK_version=2
               if [[ ! $JDK_version =~ ^[1-3]$ ]]; then
-                echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+                echo "${CWARNING}input error! Please only input number 1~3${CEND}"
               else
                 break
               fi
@@ -152,7 +152,7 @@ while :; do echo
               read -p "Please input a number:(Default 2 press Enter) " JDK_version
               [ -z "$JDK_version" ] && JDK_version=2
               if [[ ! $JDK_version =~ ^[2-3]$ ]]; then
-                echo "${CWARNING}input error! Please only input number 2,3${CEND}"
+                echo "${CWARNING}input error! Please only input number 2~3${CEND}"
               else
                 break
               fi
@@ -204,7 +204,7 @@ while :; do echo
               read -p "Please input a number:(Default 1 press Enter) " dbInstallMethods
               [ -z "$dbInstallMethods" ] && dbInstallMethods=1
               if [[ ! $dbInstallMethods =~ ^[1-2]$ ]]; then
-                echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+                echo "${CWARNING}input error! Please only input number 1~2${CEND}"
               else
                 break
               fi
@@ -236,10 +236,11 @@ while :; do echo
         echo -e "\t${CMSG}4${CEND}. Install php-5.6"
         echo -e "\t${CMSG}5${CEND}. Install php-7.0"
         echo -e "\t${CMSG}6${CEND}. Install php-7.1"
-        read -p "Please input a number:(Default 4 press Enter) " PHP_version
-        [ -z "$PHP_version" ] && PHP_version=4
-        if [[ ! $PHP_version =~ ^[1-6]$ ]]; then
-          echo "${CWARNING}input error! Please only input number 1,2,3,4,5,6${CEND}"
+        echo -e "\t${CMSG}7${CEND}. Install php-7.2"
+        read -p "Please input a number:(Default 5 press Enter) " PHP_version
+        [ -z "$PHP_version" ] && PHP_version=5
+        if [[ ! $PHP_version =~ ^[1-7]$ ]]; then
+          echo "${CWARNING}input error! Please only input number 1~7${CEND}"
         else
           while :; do echo
             read -p "Do you want to install opcode cache of the PHP? [y/n]: " PHP_cache_yn
@@ -257,7 +258,7 @@ while :; do echo
                     read -p "Please input a number:(Default 1 press Enter) " PHP_cache
                     [ -z "$PHP_cache" ] && PHP_cache=1
                     if [[ ! $PHP_cache =~ ^[1-4]$ ]]; then
-                      echo "${CWARNING}input error! Please only input number 1,2,3,4${CEND}"
+                      echo "${CWARNING}input error! Please only input number 1~4${CEND}"
                     else
                       break
                     fi
@@ -273,7 +274,7 @@ while :; do echo
                     read -p "Please input a number:(Default 1 press Enter) " PHP_cache
                     [ -z "$PHP_cache" ] && PHP_cache=1
                     if [[ ! $PHP_cache =~ ^[1-4]$ ]]; then
-                      echo "${CWARNING}input error! Please only input number 1,2,3,4${CEND}"
+                      echo "${CWARNING}input error! Please only input number 1~4${CEND}"
                     else
                       break
                     fi
@@ -288,7 +289,7 @@ while :; do echo
                     read -p "Please input a number:(Default 1 press Enter) " PHP_cache
                     [ -z "$PHP_cache" ] && PHP_cache=1
                     if [[ ! $PHP_cache =~ ^[1-3]$ ]]; then
-                      echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+                      echo "${CWARNING}input error! Please only input number 1~3${CEND}"
                     else
                       break
                     fi
@@ -303,7 +304,7 @@ while :; do echo
                     read -p "Please input a number:(Default 1 press Enter) " PHP_cache
                     [ -z "$PHP_cache" ] && PHP_cache=1
                     if [[ ! $PHP_cache =~ ^[1-3]$ ]]; then
-                      echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+                      echo "${CWARNING}input error! Please only input number 1~3${CEND}"
                     else
                       break
                     fi
@@ -323,6 +324,7 @@ while :; do echo
                     fi
                   done
                 fi
+                [ $PHP_version == 7 ] && PHP_cache=1
               fi
               break
             fi
@@ -345,7 +347,7 @@ while :; do echo
           fi
 
           # ionCube
-          if [ "${TARGET_ARCH}" != "arm64" ]; then
+          if [ "${TARGET_ARCH}" != "arm64" ] && [[ $PHP_version =~ ^[1-6]$ ]]; then
             while :; do echo
               read -p "Do you want to install ionCube? [y/n]: " ionCube_yn
               if [[ ! $ionCube_yn =~ ^[y,n]$ ]]; then
@@ -374,7 +376,7 @@ while :; do echo
               read -p "Please input a number:(Default 1 press Enter) " Magick
               [ -z "$Magick" ] && Magick=1
               if [[ ! $Magick =~ ^[1-2]$ ]]; then
-                echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+                echo "${CWARNING}input error! Please only input number 1~2${CEND}"
               else
                 break
               fi
@@ -400,7 +402,7 @@ while :; do echo
 done
 
 # check phpMyAdmin
-if [[ $PHP_version =~ ^[1-6]$ ]] || [ -e "$php_install_dir/bin/phpize" ]; then
+if [[ $PHP_version =~ ^[1-7]$ ]] || [ -e "$php_install_dir/bin/phpize" ]; then
   while :; do echo
     read -p "Do you want to install phpMyAdmin? [y/n]: " phpMyAdmin_yn
     if [[ ! $phpMyAdmin_yn =~ ^[y,n]$ ]]; then
@@ -510,7 +512,7 @@ fi
 
 # openSSL 
 . ./include/openssl.sh
-if [[ $Tomcat_version =~ ^[1-3]$ ]] || [[ $Apache_version =~ ^[1-2]$ ]] || [[ $PHP_version =~ ^[1-6]$ ]]; then
+if [[ $Tomcat_version =~ ^[1-3]$ ]] || [[ $Apache_version =~ ^[1-2]$ ]] || [[ $PHP_version =~ ^[1-7]$ ]]; then
   Install_openSSL102 | tee -a $oneinstack_dir/install.log
 fi
 
@@ -613,6 +615,10 @@ case "${PHP_version}" in
     . include/php-7.1.sh
     Install_PHP71 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
+  7)
+    . include/php-7.2.sh
+    Install_PHP72 2>&1 | tee -a ${oneinstack_dir}/install.log
+    ;;
 esac
 
 # ImageMagick or GraphicsMagick

+ 1 - 1
ss.sh

@@ -98,7 +98,7 @@ Def_parameter() {
       read -p "Please input a number:(Default 1 press Enter) " SS_version
       [ -z "${SS_version}" ] && SS_version=1
       if [[ ! "${SS_version}" =~ ^[1-2]$ ]]; then
-        echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+        echo "${CWARNING}input error! Please only input number 1~2${CEND}"
       else
         break
       fi

+ 5 - 4
versions.txt

@@ -14,14 +14,14 @@ apache22_version=2.2.34
 pcre_version=8.41
 apr_version=1.6.3
 apr_util_version=1.6.1
-nghttp2_version=1.27.0
+nghttp2_version=1.28.0
 
 # DB
 mysql57_version=5.7.20
 mysql56_version=5.6.38
 mysql55_version=5.5.58
 
-mariadb102_version=10.2.10
+mariadb102_version=10.2.11
 mariadb101_version=10.1.29
 mariadb100_version=10.0.33
 mariadb55_version=5.5.58
@@ -38,6 +38,7 @@ jdk17_version=1.7.0_80
 jdk16_version=1.6.0_45
 
 # PHP
+php72_version=7.2.0
 php71_version=7.1.12
 php70_version=7.0.26
 php56_version=5.6.32
@@ -50,7 +51,7 @@ curl_version=7.56.1
 libmcrypt_version=2.5.8
 mcrypt_version=2.6.8
 mhash_version=0.9.9.9
-ImageMagick_version=6.9.9-23
+ImageMagick_version=6.9.9-25
 imagick_version=3.4.3
 GraphicsMagick_version=1.3.26
 gmagick_for_php7_version=2.0.4RC1
@@ -66,7 +67,7 @@ swoole_version=1.9.23
 pureftpd_version=1.0.47
 
 # Redis
-redis_version=4.0.2
+redis_version=4.0.4
 redis_pecl_version=3.1.4
 
 # Memcached

+ 4 - 4
vhost.sh

@@ -46,7 +46,7 @@ Choose_env() {
       read -p "Please input a number:(Default 1 press Enter) " Choose_number
       [ -z "${Choose_number}" ] && Choose_number=1
       if [[ ! ${Choose_number} =~ ^[1-3]$ ]]; then
-        echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
+        echo "${CWARNING}input error! Please only input number 1~3${CEND}"
       else
         break
       fi
@@ -71,7 +71,7 @@ Choose_env() {
       read -p "Please input a number:(Default 1 press Enter) " Choose_number
       [ -z "${Choose_number}" ] && Choose_number=1
       if [[ ! ${Choose_number} =~ ^[1-2]$ ]]; then
-        echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+        echo "${CWARNING}input error! Please only input number 1~2${CEND}"
       else
         break
       fi
@@ -90,7 +90,7 @@ Choose_env() {
       read -p "Please input a number:(Default 1 press Enter) " Choose_number
       [ -z "${Choose_number}" ] && Choose_number=1
       if [[ ! ${Choose_number} =~ ^[1-2]$ ]]; then
-        echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+        echo "${CWARNING}input error! Please only input number 1~2${CEND}"
       else
         break
       fi
@@ -106,7 +106,7 @@ Choose_env() {
       read -p "Please input a number:(Default 1 press Enter) " Choose_number
       [ -z "${Choose_number}" ] && Choose_number=1
       if [[ ! ${Choose_number} =~ ^[1-2]$ ]]; then
-        echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+        echo "${CWARNING}input error! Please only input number 1~2${CEND}"
       else
         break
       fi