lj2007331@gmail.com 3 anni fa
parent
commit
c267cea77b
58 ha cambiato i file con 515 aggiunte e 173 eliminazioni
  1. 20 0
      config/nginx.conf
  2. 20 0
      config/nginx_apache.conf
  3. 20 0
      config/nginx_tomcat.conf
  4. 9 3
      include/apache.sh
  5. 27 24
      include/check_download.sh
  6. 6 8
      include/check_os.sh
  7. 3 3
      include/check_sw.sh
  8. 1 1
      include/download.sh
  9. 8 6
      include/get_ipaddr_state.py
  10. 1 1
      include/jdk-1.6.sh
  11. 1 1
      include/jdk-1.7.sh
  12. 1 1
      include/jdk-1.8.sh
  13. 1 1
      include/jdk-11.0.sh
  14. 1 1
      include/jemalloc.sh
  15. 1 1
      include/mariadb-10.4.sh
  16. 1 1
      include/mariadb-10.5.sh
  17. 1 1
      include/mariadb-10.6.sh
  18. 1 1
      include/mariadb-5.5.sh
  19. 1 1
      include/memcached.sh
  20. 1 1
      include/mongodb.sh
  21. 4 0
      include/mphp.sh
  22. 1 1
      include/mysql-5.5.sh
  23. 1 1
      include/mysql-5.6.sh
  24. 1 1
      include/mysql-5.7.sh
  25. 1 1
      include/mysql-8.0.sh
  26. 3 3
      include/nginx.sh
  27. 6 6
      include/ngx_lua_waf.sh
  28. 1 1
      include/node.sh
  29. 3 3
      include/openresty.sh
  30. 3 27
      include/openssl.sh
  31. 1 1
      include/pecl_fileinfo.sh
  32. 1 1
      include/percona-5.5.sh
  33. 1 1
      include/percona-5.6.sh
  34. 1 1
      include/percona-5.7.sh
  35. 1 1
      include/percona-8.0.sh
  36. 2 2
      include/php-5.3.sh
  37. 2 2
      include/php-5.4.sh
  38. 2 2
      include/php-5.5.sh
  39. 2 2
      include/php-5.6.sh
  40. 2 2
      include/php-7.0.sh
  41. 2 2
      include/php-7.1.sh
  42. 2 2
      include/php-7.2.sh
  43. 2 2
      include/php-7.3.sh
  44. 2 2
      include/php-7.4.sh
  45. 2 2
      include/php-8.0.sh
  46. 289 0
      include/php-8.1.sh
  47. 1 1
      include/postgresql.sh
  48. 1 1
      include/pureftpd.sh
  49. 1 1
      include/redis.sh
  50. 3 3
      include/tengine.sh
  51. 1 1
      include/tomcat-10.sh
  52. 1 1
      include/tomcat-7.sh
  53. 1 1
      include/tomcat-8.sh
  54. 1 1
      include/tomcat-9.sh
  55. 18 17
      install.sh
  56. 4 4
      uninstall.sh
  57. 14 13
      versions.txt
  58. 6 4
      vhost.sh

+ 20 - 0
config/nginx.conf

@@ -62,6 +62,26 @@ http {
   #open_file_cache_min_uses 2;
   #open_file_cache_errors on;
 
+  log_format json escape=json '{"@timestamp":"$time_iso8601",'
+                      '"server_addr":"$server_addr",'
+                      '"remote_addr":"$remote_addr",'
+                      '"scheme":"$scheme",'
+                      '"request_method":"$request_method",'
+                      '"request_uri": "$request_uri",'
+                      '"request_length": "$request_length",'
+                      '"uri": "$uri", '
+                      '"request_time":$request_time,'
+                      '"body_bytes_sent":$body_bytes_sent,'
+                      '"bytes_sent":$bytes_sent,'
+                      '"status":"$status",'
+                      '"upstream_time":"$upstream_response_time",'
+                      '"upstream_host":"$upstream_addr",'
+                      '"upstream_status":"$upstream_status",'
+                      '"host":"$host",'
+                      '"http_referer":"$http_referer",'
+                      '"http_user_agent":"$http_user_agent"'
+                      '}';
+
 ######################## default ############################
   server {
     listen 80;

+ 20 - 0
config/nginx_apache.conf

@@ -62,6 +62,26 @@ http {
   #open_file_cache_min_uses 2;
   #open_file_cache_errors on;
 
+  log_format json escape=json '{"@timestamp":"$time_iso8601",'
+                      '"server_addr":"$server_addr",'
+                      '"remote_addr":"$remote_addr",'
+                      '"scheme":"$scheme",'
+                      '"request_method":"$request_method",'
+                      '"request_uri": "$request_uri",'
+                      '"request_length": "$request_length",'
+                      '"uri": "$uri", '
+                      '"request_time":$request_time,'
+                      '"body_bytes_sent":$body_bytes_sent,'
+                      '"bytes_sent":$bytes_sent,'
+                      '"status":"$status",'
+                      '"upstream_time":"$upstream_response_time",'
+                      '"upstream_host":"$upstream_addr",'
+                      '"upstream_status":"$upstream_status",'
+                      '"host":"$host",'
+                      '"http_referer":"$http_referer",'
+                      '"http_user_agent":"$http_user_agent"'
+                      '}';
+
 ######################## default ############################
   server {
     listen 80;

+ 20 - 0
config/nginx_tomcat.conf

@@ -62,6 +62,26 @@ http {
   #open_file_cache_min_uses 2;
   #open_file_cache_errors on;
 
+  log_format json escape=json '{"@timestamp":"$time_iso8601",'
+                      '"server_addr":"$server_addr",'
+                      '"remote_addr":"$remote_addr",'
+                      '"scheme":"$scheme",'
+                      '"request_method":"$request_method",'
+                      '"request_uri": "$request_uri",'
+                      '"request_length": "$request_length",'
+                      '"uri": "$uri", '
+                      '"request_time":$request_time,'
+                      '"body_bytes_sent":$body_bytes_sent,'
+                      '"bytes_sent":$bytes_sent,'
+                      '"status":"$status",'
+                      '"upstream_time":"$upstream_response_time",'
+                      '"upstream_host":"$upstream_addr",'
+                      '"upstream_status":"$upstream_status",'
+                      '"host":"$host",'
+                      '"http_referer":"$http_referer",'
+                      '"http_user_agent":"$http_user_agent"'
+                      '}';
+
 ######################## default ############################
   server {
     listen 80;

+ 9 - 3
include/apache.sh

@@ -53,9 +53,14 @@ Install_Apache() {
     rm -rf nghttp2-${nghttp2_ver}
   fi
 
+  if openssl version | grep -Eqi 'OpenSSL 1.1'; then
+    with_ssl="--with-ssl"
+  else
+    with_old_ssl_flag='y'
+    with_ssl="--with-ssl=${openssl_install_dir}"
+  fi
   pushd httpd-${apache_ver} > /dev/null
-  [ ! -d "${apache_install_dir}" ] && mkdir -p ${apache_install_dir}
-  LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --enable-mpms-shared=all --with-pcre --with-apr=${apr_install_dir} --with-apr-util=${apr_install_dir} --enable-headers --enable-mime-magic --enable-deflate --enable-proxy --enable-so --enable-dav --enable-rewrite --enable-remoteip --enable-expires --enable-static-support --enable-suexec --enable-mods-shared=most --enable-nonportable-atomics=yes --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local
+  LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --enable-mpms-shared=all --with-pcre --with-apr=${apr_install_dir} --with-apr-util=${apr_install_dir} --enable-headers --enable-mime-magic --enable-deflate --enable-proxy --enable-so --enable-dav --enable-rewrite --enable-remoteip --enable-expires --enable-static-support --enable-suexec --enable-mods-shared=most --enable-nonportable-atomics=yes --enable-ssl ${with_ssl} --enable-http2 --with-nghttp2=/usr/local
   make -j ${THREAD} && make install
   popd > /dev/null
   unset LDFLAGS
@@ -65,7 +70,7 @@ Install_Apache() {
   else
     rm -rf ${apache_install_dir}
     echo "${CFAILURE}Apache install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${apache_install_dir}/bin:\$PATH" >> /etc/profile
@@ -194,6 +199,7 @@ EOF
     sed -i "s@LogFormat \"%h %l@LogFormat \"%h %a %l@g" ${apache_install_dir}/conf/httpd.conf
   fi
   ldconfig
+  [ "${with_old_ssl_flag}" == 'y' ] && sed -i "s@^export LD_LIBRARY_PATH.*@export LD_LIBRARY_PATH=${openssl_install_dir}/lib:\$LD_LIBRARY_PATH@" ${apache_install_dir}/bin/envvars
   service httpd start
   popd > /dev/null
 }

+ 27 - 24
include/check_download.sh

@@ -17,21 +17,19 @@ checkDownload() {
   fi
 
   # General system utils
-
-  # openssl
-  if [[ "${tomcat_option}" =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [[ "${php_flag}" == 'y' ]] || "${mphp_flag}" == 'y' || [[ "${nginx_option}" =~ ^[1-3]$ ]]; then
-    # Only the deprecated PHP5 requires openssl 1.0.2
-    if [[ "${php_option}" =~ ^[1-4]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$ ]]; then
-      echo "Download openSSL 1.0.2..."
-      src_url=https://www.openssl.org/source/old/1.0.2/openssl-${openssl_ver}.tar.gz && Download_src
-    else
-      echo "Download openSSL 1.1..."
-      src_url=https://www.openssl.org/source/openssl-${openssl11_ver}.tar.gz && Download_src
-    fi
+  if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [[ ${php_option} =~ ^[1-9]$|^1[0-1]$ ]]; then
+    echo "Download openSSL..."
+    src_url=https://www.openssl.org/source/old/1.0.2/openssl-${openssl_ver}.tar.gz && Download_src
     echo "Download cacert.pem..."
     src_url=https://curl.se/ca/cacert.pem && Download_src
   fi
 
+  # openssl1.1
+  if [[ ${nginx_option} =~ ^[1-3]$ ]]; then
+      echo "Download openSSL1.1..."
+      src_url=https://www.openssl.org/source/openssl-${openssl11_ver}.tar.gz && Download_src
+  fi
+
   # jemalloc
   if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]]; then
     echo "Download jemalloc..."
@@ -159,7 +157,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       2)
@@ -194,7 +192,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       3)
@@ -229,7 +227,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       4)
@@ -265,7 +263,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       [5-8])
@@ -318,7 +316,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       9)
@@ -350,7 +348,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       10)
@@ -382,7 +380,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       11)
@@ -415,7 +413,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       12)
@@ -448,7 +446,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       13)
@@ -472,7 +470,7 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
       14)
@@ -496,14 +494,14 @@ checkDownload() {
         done
         if [ "${tryDlCount}" == '6' ]; then
           echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
-          kill -9 $$
+          kill -9 $$; exit 1;
         fi
         ;;
     esac
   fi
 
   # PHP
-  if [[ "${php_option}" =~ ^[1-9]$|^10$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]]; then
+  if [[ "${php_option}" =~ ^[1-9]$|^1[0-1]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-1]$ ]]; then
     echo "PHP common..."
     src_url=${mirrorLink}/libiconv-${libiconv_ver}.tar.gz && Download_src
     src_url=https://curl.haxx.se/download/curl-${curl_ver}.tar.gz && Download_src
@@ -548,6 +546,11 @@ checkDownload() {
     src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
     src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
     src_url=http://mirrors.linuxeye.com/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
+  elif [ "${php_option}" == '11' ] || [ "${mphp_ver}" == '81' ]; then
+    src_url=https://secure.php.net/distributions/php-${php81_ver}.tar.gz && Download_src
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
+    src_url=http://mirrors.linuxeye.com/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
   fi
 
   # PHP OPCache
@@ -727,7 +730,7 @@ checkDownload() {
   # phpMyAdmin
   if [ "${phpmyadmin_flag}" == 'y' ]; then
     echo "Download phpMyAdmin..."
-    if [[ "${php_option}" =~ ^[1-5]$ ]]; then
+    if [[ "${php_option}" =~ ^[1-5]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^70$ ]]; then
       src_url=https://files.phpmyadmin.net/phpMyAdmin/${phpmyadmin_oldver}/phpMyAdmin-${phpmyadmin_oldver}-all-languages.tar.gz && Download_src
     else
       src_url=https://files.phpmyadmin.net/phpMyAdmin/${phpmyadmin_ver}/phpMyAdmin-${phpmyadmin_ver}-all-languages.tar.gz && Download_src

+ 6 - 8
include/check_os.sh

@@ -19,11 +19,7 @@ if [ -e "/usr/bin/yum" ]; then
     if [ -e "/etc/euleros-release" ]; then
       yum -y install euleros-lsb
     elif [ -e "/etc/openEuler-release" -o -e "/etc/openeuler-release" ]; then
-      if [ -n "$(grep -w '"20.03"' /etc/os-release)" ]; then
-        rpm -Uvh https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/openeuler-lsb-5.0-1.oe1.aarch64.rpm
-      else
-        yum -y install openeuler-lsb
-      fi
+      yum -y install openeuler-lsb
     else
       yum -y install redhat-lsb-core
     fi
@@ -36,15 +32,17 @@ if [ -e "/usr/bin/apt-get" ]; then
   command -v lsb_release >/dev/null 2>&1 || { apt-get -y update > /dev/null; apt-get -y install lsb-release; clear; }
 fi
 
-command -v lsb_release >/dev/null 2>&1 || { echo "${CFAILURE}${PM} source failed! ${CEND}"; kill -9 $$; }
+command -v lsb_release >/dev/null 2>&1 || { echo "${CFAILURE}${PM} source failed! ${CEND}"; kill -9 $$; exit 1; }
+[ -e "/etc/anolis-release" ] && { command -v lsb_release >/dev/null 2>&1 || yum -y install system-lsb-core; }
 
 # Get OS Version
 OS=$(lsb_release -is)
-if [[ "${OS}" =~ ^CentOS$|^CentOSStream$|^RedHat$|^Rocky$|^Fedora$|^Amazon$|^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$|^EulerOS$|^openEuler$ ]]; then
+if [[ "${OS}" =~ ^CentOS$|^CentOSStream$|^RedHat$|^Rocky$|^Fedora$|^Amazon$|^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$|^AnolisOS$|^EulerOS$|^openEuler$ ]]; then
   LikeOS=RHEL
   RHEL_ver=$(lsb_release -rs | awk -F. '{print $1}' | awk '{print $1}')
   [[ "${OS}" =~ ^Fedora$ ]] && [ ${RHEL_ver} -ge 19 >/dev/null 2>&1 ] && { RHEL_ver=7; Fedora_ver=$(lsb_release -rs); }
   [[ "${OS}" =~ ^Amazon$|^EulerOS$|^openEuler$ ]] && RHEL_ver=7
+  [[ "${OS}" =~ ^openEuler$ ]] && [[ "${RHEL_ver}" =~ ^21$ ]] && RHEL_ver=8
   [[ "${OS}" =~ ^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$ ]] && [[ "${RHEL_ver}" =~ ^2$ ]] && RHEL_ver=7
   [[ "${OS}" =~ ^AlibabaCloud$|^AlibabaCloud\(AliyunLinux\)$ ]] && [[ "${RHEL_ver}" =~ ^3$ ]] && RHEL_ver=8
 elif [[ "${OS}" =~ ^Debian$|^Deepin$|^Uos$|^Kali$ ]]; then
@@ -69,7 +67,7 @@ fi
 # Check OS Version
 if [ ${RHEL_ver} -lt 6 >/dev/null 2>&1 ] || [ ${Debian_ver} -lt 8 >/dev/null 2>&1 ] || [ ${Ubuntu_ver} -lt 16 >/dev/null 2>&1 ]; then
   echo "${CFAILURE}Does not support this OS, Please install CentOS 6+,Debian 8+,Ubuntu 16+ ${CEND}"
-  kill -9 $$
+  kill -9 $$; exit 1;
 fi
 
 command -v gcc > /dev/null 2>&1 || $PM -y install gcc

+ 3 - 3
include/check_sw.sh

@@ -46,7 +46,7 @@ installDepsDebian() {
       ;;
     *)
       echo "${CFAILURE}Your system Debian ${Debian_ver} are not supported!${CEND}"
-      kill -9 $$
+      kill -9 $$; exit 1;
       ;;
   esac
   for Package in ${pkgList}; do
@@ -82,7 +82,7 @@ installDepsRHEL() {
 
   echo "${CMSG}Installing dependencies packages...${CEND}"
   # Install needed packages
-  pkgList="deltarpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel libzip libzip-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel net-tools libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel libmcrypt libmcrypt-devel mhash mhash-devel mcrypt zip unzip ntpdate sqlite-devel sysstat patch bc expect expat-devel oniguruma oniguruma-devel libtirpc-devel nss rsync rsyslog git lsof lrzsz psmisc wget which libatomic tmux"
+  pkgList="deltarpm gcc gcc-c++ make cmake autoconf libjpeg libjpeg-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel libzip libzip-devel glibc glibc-devel krb5-devel libc-client libc-client-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel libaio numactl numactl-libs readline-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel net-tools libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel libmcrypt libmcrypt-devel mhash mhash-devel mcrypt zip unzip ntpdate sqlite-devel sysstat patch bc expect expat-devel oniguruma oniguruma-devel libtirpc-devel nss libnsl rsync rsyslog git lsof lrzsz psmisc wget which libatomic tmux"
   for Package in ${pkgList}; do
     yum -y install ${Package}
   done
@@ -149,7 +149,7 @@ installDepsBySrc() {
     echo 'already initialize' > ~/.oneinstack
   else
     echo "${CFAILURE}${PM} config error parsing file failed${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   popd > /dev/null

+ 1 - 1
include/download.sh

@@ -12,6 +12,6 @@ Download_src() {
   [ -s "${src_url##*/}" ] && echo "[${CMSG}${src_url##*/}${CEND}] found" || { wget --limit-rate=100M --tries=6 -c --no-check-certificate ${src_url}; sleep 1; }
   if [ ! -e "${src_url##*/}" ]; then
     echo "${CFAILURE}Auto download failed! You can manually download ${src_url} into the oneinstack/src directory.${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 }

+ 8 - 6
include/get_ipaddr_state.py

@@ -10,14 +10,16 @@ else:
 try:
   socket.setdefaulttimeout(5)
   if len(sys.argv) == 1:
-    apiurl = "http://ip-api.com/json"
+      apiurl = "http://ip.geo.iqiyi.com/cityjson?format=json"
   elif len(sys.argv) == 2:
-    apiurl = "http://ip-api.com/json/%s" % sys.argv[1]
+      apiurl = "http://ip.geo.iqiyi.com/cityjson?format=json&ip=%s" % sys.argv[1]
   content = request.urlopen(apiurl).read().decode('utf-8')
   content = json.JSONDecoder().decode(content)
-  if content['status'] == 'success':
-    print(content['countryCode'])
-  else:
-    print("CN")
+  #print(content)
+  if content['code'] == 'A00000':
+    if content['data']['country_id'] == 48:
+      print("CN")
+    else:
+      print(content['data']['country'])
 except:
   print("Usage:%s IP" % sys.argv[0])

+ 1 - 1
include/jdk-1.6.sh

@@ -30,7 +30,7 @@ Install_JDK16() {
     echo "${CSUCCESS}$JDK_NAME installed successfully! ${CEND}"
   else
     echo "${CFAILURE}JDK install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd
 }

+ 1 - 1
include/jdk-1.7.sh

@@ -29,7 +29,7 @@ Install_JDK17() {
   else
     rm -rf $JAVA_dir
     echo "${CFAILURE}JDK install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd
 }

+ 1 - 1
include/jdk-1.8.sh

@@ -28,7 +28,7 @@ Install_JDK18() {
     echo "${CSUCCESS}$JDK_NAME installed successfully! ${CEND}"
   else
     echo "${CFAILURE}JDK install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd
 }

+ 1 - 1
include/jdk-11.0.sh

@@ -28,7 +28,7 @@ Install_JDK110() {
     echo "${CSUCCESS}$JDK_NAME installed successfully! ${CEND}"
   else
     echo "${CFAILURE}JDK install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd
 }

+ 1 - 1
include/jemalloc.sh

@@ -28,7 +28,7 @@ Install_Jemalloc() {
       rm -rf jemalloc-${jemalloc_ver}
     else
       echo "${CFAILURE}jemalloc install failed, Please contact the author! ${CEND}" && lsb_release -a
-      kill -9 $$
+      kill -9 $$; exit 1;
     fi
     popd > /dev/null
   fi

+ 1 - 1
include/mariadb-10.4.sh

@@ -59,7 +59,7 @@ Install_MariaDB104() {
   else
     rm -rf ${mariadb_install_dir}
     echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mariadb_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/mariadb-10.5.sh

@@ -59,7 +59,7 @@ Install_MariaDB105() {
   else
     rm -rf ${mariadb_install_dir}
     echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mariadb_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/mariadb-10.6.sh

@@ -59,7 +59,7 @@ Install_MariaDB106() {
   else
     rm -rf ${mariadb_install_dir}
     echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mariadb_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/mariadb-5.5.sh

@@ -57,7 +57,7 @@ Install_MariaDB55() {
   else
     rm -rf ${mariadb_install_dir}
     echo "${CFAILURE}MariaDB install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mariadb_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/memcached.sh

@@ -36,7 +36,7 @@ Install_memcached_server() {
   else
     rm -rf ${memcached_install_dir}
     echo "${CFAILURE}memcached-server install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd > /dev/null
 }

+ 1 - 1
include/mongodb.sh

@@ -75,7 +75,7 @@ EOF
   else
     rm -rf ${mongo_install_dir} ${mongo_data_dir}
     echo "${CFAILURE}MongoDB install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd
   [ -z "$(grep ^'export PATH=' /etc/profile)" ] && echo "export PATH=${mongo_install_dir}/bin:\$PATH" >> /etc/profile

+ 4 - 0
include/mphp.sh

@@ -57,6 +57,10 @@ Install_MPHP() {
           . include/php-8.0.sh
           Install_PHP80 2>&1 | tee -a ${oneinstack_dir}/install.log
           ;;
+        81)
+          . include/php-8.1.sh
+          Install_PHP81 2>&1 | tee -a ${oneinstack_dir}/install.log
+          ;;
       esac
       if [ -e "${php_install_dir}/sbin/php-fpm" ]; then
         service php-fpm stop

+ 1 - 1
include/mysql-5.5.sh

@@ -57,7 +57,7 @@ Install_MySQL55() {
   else
     rm -rf ${mysql_install_dir}
     echo "${CFAILURE}MySQL install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mysql_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/mysql-5.6.sh

@@ -55,7 +55,7 @@ Install_MySQL56() {
   else
     rm -rf ${mysql_install_dir}
     echo "${CFAILURE}MySQL install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mysql_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/mysql-5.7.sh

@@ -59,7 +59,7 @@ Install_MySQL57() {
   else
     rm -rf ${mysql_install_dir}
     echo "${CFAILURE}MySQL install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mysql_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/mysql-8.0.sh

@@ -62,7 +62,7 @@ Install_MySQL80() {
   else
     rm -rf ${mysql_install_dir}
     echo "${CFAILURE}MySQL install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${mysql_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 3 - 3
include/nginx.sh

@@ -37,7 +37,7 @@ Install_Nginx() {
   else
     rm -rf ${nginx_install_dir}
     echo "${CFAILURE}Nginx install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${nginx_install_dir}/sbin:\$PATH" >> /etc/profile
@@ -56,11 +56,11 @@ Install_Nginx() {
   mv ${nginx_install_dir}/conf/nginx.conf{,_bk}
   if [ "${apache_flag}" == 'y' ] || [ -e "${apache_install_dir}/bin/httpd" ]; then
     /bin/cp ../config/nginx_apache.conf ${nginx_install_dir}/conf/nginx.conf
-  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
+  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
     /bin/cp ../config/nginx_tomcat.conf ${nginx_install_dir}/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${nginx_install_dir}/conf/nginx.conf
-    [[ "${php_option}" =~ ^[1-9]$|^10$ ]] && [ -z "`grep '/php-fpm_status' ${nginx_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${nginx_install_dir}/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-9]$|^1[0-1]$ ]] && [ -z "`grep '/php-fpm_status' ${nginx_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${nginx_install_dir}/conf/nginx.conf
   fi
   cat > ${nginx_install_dir}/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 6 - 6
include/ngx_lua_waf.sh

@@ -17,7 +17,7 @@ Nginx_lua_waf() {
     tar xzf luajit2-${luajit2_ver}.tar.gz
     pushd luajit2-${luajit2_ver}
     make && make install
-    [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ] && { echo "${CFAILURE}LuaJIT install failed! ${CEND}"; kill -9 $$; }
+    [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ] && { echo "${CFAILURE}LuaJIT install failed! ${CEND}"; kill -9 $$; exit 1; }
     popd > /dev/null
     rm -rf luajit2-${luajit2_ver}
   fi
@@ -44,7 +44,7 @@ Nginx_lua_waf() {
     pushd lua-cjson-${lua_cjson_ver}
     sed -i 's@^LUA_INCLUDE_DIR.*@&/luajit-2.1@' Makefile
     make && make install
-    [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ] && { echo "${CFAILURE}lua-cjson install failed! ${CEND}"; kill -9 $$; }
+    [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ] && { echo "${CFAILURE}lua-cjson install failed! ${CEND}"; kill -9 $$; exit 1; }
     popd > /dev/null
   fi
   ${nginx_install_dir}/sbin/nginx -V &> $$
@@ -81,7 +81,7 @@ Nginx_lua_waf() {
       rm -rf nginx-${nginx_ver}
     else
       echo "${CFAILURE}lua-nginx-module install failed! ${CEND}"
-      kill -9 $$
+      kill -9 $$; exit 1;
     fi
   fi
   popd > /dev/null
@@ -96,7 +96,7 @@ Tengine_lua_waf() {
     tar xzf luajit2-${luajit2_ver}.tar.gz
     pushd luajit2-${luajit2_ver}
     make && make install
-    [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ] && { echo "${CFAILURE}LuaJIT install failed! ${CEND}"; kill -9 $$; }
+    [ ! -e "/usr/local/lib/libluajit-5.1.so.2.1.0" ] && { echo "${CFAILURE}LuaJIT install failed! ${CEND}"; kill -9 $$; exit 1; }
     popd > /dev/null
   fi
   if [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ]; then
@@ -105,7 +105,7 @@ Tengine_lua_waf() {
     pushd lua-cjson-${lua_cjson_ver}
     sed -i 's@^LUA_INCLUDE_DIR.*@&/luajit-2.1@' Makefile
     make && make install
-    [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ] && { echo "${CFAILURE}lua-cjson install failed! ${CEND}"; kill -9 $$; }
+    [ ! -e "/usr/local/lib/lua/5.1/cjson.so" ] && { echo "${CFAILURE}lua-cjson install failed! ${CEND}"; kill -9 $$; exit 1; }
     popd > /dev/null
   fi
   ${tengine_install_dir}/sbin/nginx -V &> $$
@@ -144,7 +144,7 @@ Tengine_lua_waf() {
       rm -rf tengine-${tengine_ver}
     else
       echo "${CFAILURE}lua_module install failed! ${CEND}"
-      kill -9 $$
+      kill -9 $$; exit 1;
     fi
   fi
   popd > /dev/null

+ 1 - 1
include/node.sh

@@ -21,7 +21,7 @@ EOF
     echo "${CSUCCESS}Nodejs installed successfully! ${CEND}"
   else
     echo "${CFAILURE}Nodejs install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd > /dev/null
 }

+ 3 - 3
include/openresty.sh

@@ -33,7 +33,7 @@ Install_OpenResty() {
   else
     rm -rf ${openresty_install_dir}
     echo "${CFAILURE}OpenResty install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${openresty_install_dir}/nginx/sbin:\$PATH" >> /etc/profile
@@ -52,11 +52,11 @@ Install_OpenResty() {
   mv ${openresty_install_dir}/nginx/conf/nginx.conf{,_bk}
   if [ "${apache_flag}" == 'y' ] || [ -e "${apache_install_dir}/bin/httpd" ]; then
     /bin/cp ../config/nginx_apache.conf ${openresty_install_dir}/nginx/conf/nginx.conf 
-  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
+  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
     /bin/cp ../config/nginx_tomcat.conf ${openresty_install_dir}/nginx/conf/nginx.conf 
   else
     /bin/cp ../config/nginx.conf ${openresty_install_dir}/nginx/conf/nginx.conf
-    [[ "${php_option}" =~ ^[1-9]$|^10$ ]] && [ -z "`grep '/php-fpm_status' ${openresty_install_dir}/nginx/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${openresty_install_dir}/nginx/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-9]$|^1[0-1]$ ]] && [ -z "`grep '/php-fpm_status' ${openresty_install_dir}/nginx/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${openresty_install_dir}/nginx/conf/nginx.conf
   fi
   cat > ${openresty_install_dir}/nginx/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 3 - 27
include/openssl.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/oneinstack/oneinstack
 
-Install_openSSL102() {
+Install_openSSL() {
   if [ -e "${openssl_install_dir}/lib/libssl.a" ]; then
     echo "${CWARNING}openSSL already installed! ${CEND}"
   else
@@ -21,36 +21,12 @@ Install_openSSL102() {
     make -j ${THREAD} && make install
     popd > /dev/null
     if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
-      echo "${CSUCCESS}openssl installed successfully! ${CEND}"
+      echo "${CSUCCESS}openSSL installed successfully! ${CEND}"
       /bin/cp cacert.pem ${openssl_install_dir}/cert.pem
       rm -rf openssl-${openssl_ver}
     else
       echo "${CFAILURE}openSSL install failed, Please contact the author! ${CEND}" && lsb_release -a
-      kill -9 $$
-    fi
-    popd > /dev/null
-  fi
-}
-
-Install_openSSL() {
-  if [ -e "${openssl_install_dir}/lib/libssl.a" ]; then
-    echo "${CWARNING}openSSL already installed! ${CEND}"
-  else
-    pushd ${oneinstack_dir}/src > /dev/null
-    tar xzf openssl-${openssl11_ver}.tar.gz
-    pushd openssl-${openssl11_ver} > /dev/null
-    make clean
-    ./config -Wl,-rpath=${openssl_install_dir}/lib -fPIC --prefix=${openssl_install_dir} --openssldir=${openssl_install_dir}
-    make depend
-    make -j ${THREAD} && make install
-    popd > /dev/null
-    if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
-      echo "${CSUCCESS}openssl installed successfully! ${CEND}"
-      /bin/cp cacert.pem ${openssl_install_dir}/cert.pem
-      rm -rf openssl-${openssl11_ver}
-    else
-      echo "${CFAILURE}openSSL install failed, Please contact the author! ${CEND}" && lsb_release -a
-      kill -9 $$
+      kill -9 $$; exit 1;
     fi
     popd > /dev/null
   fi

+ 1 - 1
include/pecl_fileinfo.sh

@@ -18,7 +18,7 @@ Install_pecl_fileinfo() {
     pushd php-${PHP_detail_ver}/ext/fileinfo > /dev/null
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config
-    [ "${php_option}" == '10' ] && sed -i 's@^CFLAGS = -g -O2@CFLAGS = -std=c99 -g -O2@' Makefile
+    [[ "${php_option}" =~ ^1[0-1]$ ]] && sed -i 's@^CFLAGS = -g -O2@CFLAGS = -std=c99 -g -O2@' Makefile
     make -j ${THREAD} && make install
     popd > /dev/null
     if [ -f "${phpExtensionDir}/fileinfo.so" ]; then

+ 1 - 1
include/percona-5.5.sh

@@ -58,7 +58,7 @@ Install_Percona55() {
   else
     rm -rf ${percona_install_dir}
     echo "${CFAILURE}Percona install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${percona_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/percona-5.6.sh

@@ -57,7 +57,7 @@ Install_Percona56() {
   else
     rm -rf ${percona_install_dir}
     echo "${CFAILURE}Percona install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${percona_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/percona-5.7.sh

@@ -61,7 +61,7 @@ Install_Percona57() {
   else
     rm -rf ${percona_install_dir}
     echo "${CFAILURE}Percona install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${percona_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 1 - 1
include/percona-8.0.sh

@@ -71,7 +71,7 @@ Install_Percona80() {
   else
     rm -rf ${percona_install_dir}
     echo "${CFAILURE}Percona install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp ${percona_install_dir}/support-files/mysql.server /etc/init.d/mysqld

+ 2 - 2
include/php-5.3.sh

@@ -132,11 +132,12 @@ Install_PHP53() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -146,7 +147,6 @@ Install_PHP53() {
   # 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

+ 2 - 2
include/php-5.4.sh

@@ -129,11 +129,12 @@ Install_PHP54() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -143,7 +144,6 @@ Install_PHP54() {
   # 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

+ 2 - 2
include/php-5.5.sh

@@ -128,11 +128,12 @@ Install_PHP55() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -142,7 +143,6 @@ Install_PHP55() {
   # 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

+ 2 - 2
include/php-5.6.sh

@@ -129,11 +129,12 @@ Install_PHP56() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -143,7 +144,6 @@ Install_PHP56() {
   # 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

+ 2 - 2
include/php-7.0.sh

@@ -129,11 +129,12 @@ Install_PHP70() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -143,7 +144,6 @@ Install_PHP70() {
   # 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

+ 2 - 2
include/php-7.1.sh

@@ -128,11 +128,12 @@ Install_PHP71() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -142,7 +143,6 @@ Install_PHP71() {
   # 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

+ 2 - 2
include/php-7.2.sh

@@ -120,11 +120,12 @@ Install_PHP72() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -134,7 +135,6 @@ Install_PHP72() {
   # 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

+ 2 - 2
include/php-7.3.sh

@@ -120,11 +120,12 @@ Install_PHP73() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -134,7 +135,6 @@ Install_PHP73() {
   # 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

+ 2 - 2
include/php-7.4.sh

@@ -130,11 +130,12 @@ Install_PHP74() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -144,7 +145,6 @@ Install_PHP74() {
   # 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

+ 2 - 2
include/php-8.0.sh

@@ -131,11 +131,12 @@ Install_PHP80() {
   make install
 
   if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
     echo "${CSUCCESS}PHP installed successfully! ${CEND}"
   else
     rm -rf ${php_install_dir}
     echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
@@ -145,7 +146,6 @@ Install_PHP80() {
   # 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

+ 289 - 0
include/php-8.1.sh

@@ -0,0 +1,289 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://linuxeye.com
+#
+# Notes: OneinStack for CentOS/RedHat 7+ Debian 8+ and Ubuntu 16+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/oneinstack/oneinstack
+
+Install_PHP81() {
+  pushd ${oneinstack_dir}/src > /dev/null
+  if [ -e "${apache_install_dir}/bin/httpd" ];then
+    [ "$(${apache_install_dir}/bin/httpd -v | awk -F'.' /version/'{print $2}')" == '4' ] && Apache_main_ver=24
+    [ "$(${apache_install_dir}/bin/httpd -v | awk -F'.' /version/'{print $2}')" == '2' ] && Apache_main_ver=22
+  fi
+  if [ ! -e "${libiconv_install_dir}/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    pushd libiconv-${libiconv_ver} > /dev/null
+    ./configure --prefix=${libiconv_install_dir}
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf libiconv-${libiconv_ver}
+    ln -s ${libiconv_install_dir}/lib/libiconv.so.2 /usr/lib64/libiconv.so.2
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver} > /dev/null
+    [ "${Debian_ver}" == '8' ] && apt-get -y remove zlib1g-dev
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    [ "${Debian_ver}" == '8' ] && apt-get -y install libc-client2007e-dev libglib2.0-dev libpng12-dev libssl-dev libzip-dev zlib1g-dev
+    popd > /dev/null
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "${freetype_install_dir}/lib/libfreetype.la" ]; then
+    tar xzf freetype-${freetype_ver}.tar.gz
+    pushd freetype-${freetype_ver} > /dev/null
+    ./configure --prefix=${freetype_install_dir} --enable-freetype-config
+    make -j ${THREAD} && make install
+    ln -sf ${freetype_install_dir}/include/freetype2/* /usr/include/
+    [ -d /usr/lib/pkgconfig ] && /bin/cp ${freetype_install_dir}/lib/pkgconfig/freetype2.pc /usr/lib/pkgconfig/
+    popd > /dev/null
+    rm -rf freetype-${freetype_ver}
+  fi
+
+  if [ ! -e "/usr/lib/libargon2.a" ]; then
+    tar xzf argon2-${argon2_ver}.tar.gz
+    pushd argon2-${argon2_ver} > /dev/null
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf argon2-${argon2_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libsodium.la" ]; then
+    tar xzf libsodium-${libsodium_ver}.tar.gz
+    pushd libsodium-${libsodium_ver} > /dev/null
+    ./configure --disable-dependency-tracking --enable-minimal
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf libsodium-${libsodium_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libzip.la" ]; then
+    tar xzf libzip-${libzip_ver}.tar.gz
+    pushd libzip-${libzip_ver} > /dev/null
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf libzip-${libzip_ver}
+  fi
+
+  if [ ! -e "/usr/local/include/mhash.h" -a ! -e "/usr/include/mhash.h" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver} > /dev/null
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mhash-${mhash_ver}
+  fi
+
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  ldconfig
+
+  if [ "${PM}" == 'yum' ]; then
+    if [ "${OS_BIT}" == '64' ]; then
+      [ ! -e "/lib64/libpcre.so.1" ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      [ ! -e "/usr/lib/libc-client.so" ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
+
+  id -g ${run_group} >/dev/null 2>&1
+  [ $? -ne 0 ] && groupadd ${run_group}
+  id -u ${run_user} >/dev/null 2>&1
+  [ $? -ne 0 ] && useradd -g ${run_group} -M -s /sbin/nologin ${run_user}
+
+  tar xzf php-${php81_ver}.tar.gz
+  pushd php-${php81_ver} > /dev/null
+  make clean
+  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:$PKG_CONFIG_PATH
+  [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
+  [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
+  if [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; 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 ${phpcache_arg} --disable-fileinfo \
+    --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
+    --with-iconv --with-freetype --with-jpeg --with-zlib \
+    --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
+    --enable-sysvsem --with-curl=${curl_install_dir} --enable-mbregex \
+    --enable-mbstring --with-password-argon2 --with-sodium=/usr/local --enable-gd --with-openssl=${openssl_install_dir} \
+    --with-mhash --enable-pcntl --enable-sockets --enable-ftp --enable-intl --with-xsl \
+    --with-gettext --with-zip=/usr/local --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_group} --enable-fpm ${phpcache_arg} --disable-fileinfo \
+    --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
+    --with-iconv --with-freetype --with-jpeg --with-zlib \
+    --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
+    --enable-sysvsem --with-curl=${curl_install_dir} --enable-mbregex \
+    --enable-mbstring --with-password-argon2 --with-sodium=/usr/local --enable-gd --with-openssl=${openssl_install_dir} \
+    --with-mhash --enable-pcntl --enable-sockets --enable-ftp --enable-intl --with-xsl \
+    --with-gettext --with-zip=/usr/local --enable-soap --disable-debug ${php_modules_options}
+  fi
+  make ZEND_EXTRA_LIBS="-L${libiconv_install_dir}/lib/ -liconv" -j ${THREAD}
+  make install
+
+  if [ -e "${php_install_dir}/bin/phpize" ]; then
+    [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
+    echo "${CSUCCESS}PHP installed successfully! ${CEND}"
+  else
+    rm -rf ${php_install_dir}
+    echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
+    kill -9 $$; exit 1;
+  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
+
+  /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 = ${timezone}@" ${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,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
+  sed -i "s@^;curl.cainfo.*@curl.cainfo = \"${openssl_install_dir}/cert.pem\"@" ${php_install_dir}/etc/php.ini
+  sed -i "s@^;openssl.cafile.*@openssl.cafile = \"${openssl_install_dir}/cert.pem\"@" ${php_install_dir}/etc/php.ini
+  sed -i "s@^;openssl.capath.*@openssl.capath = \"${openssl_install_dir}/cert.pem\"@" ${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
+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.consistency_checks=0
+;opcache.optimization_level=0
+EOF
+
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
+    # php-fpm Init Script
+    if [ -e /bin/systemctl ]; then
+      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+      systemctl enable php-fpm
+    else
+      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
+      chmod +x /etc/init.d/php-fpm
+      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
+      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
+    fi
+
+    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_group}
+listen.mode = 0666
+user = ${run_user}
+group = ${run_group}
+
+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 = var/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
+
+    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
+
+    service php-fpm start
+
+  elif [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
+    service httpd restart
+  fi
+  popd > /dev/null
+  [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php81_ver}
+  popd > /dev/null
+}

+ 1 - 1
include/postgresql.sh

@@ -51,7 +51,7 @@ Install_PostgreSQL() {
   else
     rm -rf ${pgsql_install_dir} ${pgsql_data_dir}
     echo "${CFAILURE}PostgreSQL install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd
   [ -z "$(grep ^'export PATH=' /etc/profile)" ] && echo "export PATH=${pgsql_install_dir}/bin:\$PATH" >> /etc/profile

+ 1 - 1
include/pureftpd.sh

@@ -83,7 +83,7 @@ Install_PureFTPd() {
   else
     rm -rf ${pureftpd_install_dir}
     echo "${CFAILURE}Pure-Ftpd install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd > /dev/null
 }

+ 1 - 1
include/redis.sh

@@ -52,7 +52,7 @@ Install_redis_server() {
   else
     rm -rf ${redis_install_dir}
     echo "${CFAILURE}Redis-server install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
   popd > /dev/null
 }

+ 3 - 3
include/tengine.sh

@@ -32,7 +32,7 @@ Install_Tengine() {
   else
     rm -rf ${tengine_install_dir}
     echo "${CFAILURE}Tengine install failed, Please Contact the author! ${CEND}"
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${tengine_install_dir}/sbin:\$PATH" >> /etc/profile
@@ -51,11 +51,11 @@ Install_Tengine() {
   mv ${tengine_install_dir}/conf/nginx.conf{,_bk}
   if [ "${apache_flag}" == 'y' ] || [ -e "${apache_install_dir}/bin/httpd" ]; then
     /bin/cp ../config/nginx_apache.conf ${tengine_install_dir}/conf/nginx.conf
-  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
+  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
     /bin/cp ../config/nginx_tomcat.conf ${tengine_install_dir}/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${tengine_install_dir}/conf/nginx.conf
-    [[ "${php_option}" =~ ^[1-9]$|^10$ ]] && [ -z "`grep '/php-fpm_status' ${tengine_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${tengine_install_dir}/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-9]$|^1[0-1]$ ]] && [ -z "`grep '/php-fpm_status' ${tengine_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${tengine_install_dir}/conf/nginx.conf
   fi
   cat > ${tengine_install_dir}/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 1 - 1
include/tomcat-10.sh

@@ -34,7 +34,7 @@ Install_Tomcat10() {
   if [ ! -e "${tomcat_install_dir}/conf/server.xml" ]; then
     rm -rf ${tomcat_install_dir}
     echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   #[ ! -d "${tomcat_install_dir}/lib/catalina" ] && mkdir ${tomcat_install_dir}/lib/catalina

+ 1 - 1
include/tomcat-7.sh

@@ -34,7 +34,7 @@ Install_Tomcat7() {
   if [ ! -e "${tomcat_install_dir}/conf/server.xml" ]; then
     rm -rf ${tomcat_install_dir}
     echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp catalina-jmx-remote.jar ${tomcat_install_dir}/lib

+ 1 - 1
include/tomcat-8.sh

@@ -34,7 +34,7 @@ Install_Tomcat8() {
   if [ ! -e "${tomcat_install_dir}/conf/server.xml" ]; then
     rm -rf ${tomcat_install_dir}
     echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   /bin/cp catalina-jmx-remote.jar ${tomcat_install_dir}/lib

+ 1 - 1
include/tomcat-9.sh

@@ -34,7 +34,7 @@ Install_Tomcat9() {
   if [ ! -e "${tomcat_install_dir}/conf/server.xml" ]; then
     rm -rf ${tomcat_install_dir}
     echo "${CFAILURE}Tomcat install failed, Please contact the author! ${CEND}" && lsb_release -a
-    kill -9 $$
+    kill -9 $$; exit 1;
   fi
 
   #[ ! -d "${tomcat_install_dir}/lib/catalina" ] && mkdir ${tomcat_install_dir}/lib/catalina

+ 18 - 17
install.sh

@@ -37,7 +37,7 @@ dbinstallmethod=1
 
 version() {
   echo "version: 2.4"
-  echo "updated date: 2021-05-18"
+  echo "updated date: 2021-10-01"
 }
 
 Show_Help() {
@@ -49,8 +49,8 @@ Show_Help() {
   --apache                    Install Apache
   --apache_mode_option [1-2]  Apache2.4 mode, 1(default): php-fpm, 2: mod_php
   --apache_mpm_option [1-3]   Apache2.4 MPM, 1(default): event, 2: prefork, 3: worker
-  --php_option [1-10]         Install PHP version
-  --mphp_ver [53~80]          Install another PHP version (PATH: ${php_install_dir}\${mphp_ver})
+  --php_option [1-11]         Install PHP version
+  --mphp_ver [53~81]          Install another PHP version (PATH: ${php_install_dir}\${mphp_ver})
   --mphp_addons               Only install another PHP addons
   --phpcache_option [1-4]     Install PHP opcode cache, default: 1 opcache
   --php_extensions [ext name] Install PHP extensions, include zendguardloader,ioncube,
@@ -106,12 +106,12 @@ while :; do
       ;;
     --php_option)
       php_option=$2; shift 2
-      [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~10${CEND}"; exit 1; }
+      [[ ! ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~11${CEND}"; exit 1; }
       [ -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP already installed! ${CEND}"; unset php_option; }
       ;;
     --mphp_ver)
       mphp_ver=$2; mphp_flag=y; shift 2
-      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~80${CEND}"; exit 1; }
+      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-1]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~81${CEND}"; exit 1; }
       ;;
     --mphp_addons)
       mphp_addons_flag=y; shift 1
@@ -478,10 +478,11 @@ if [ ${ARG_NUM} == 0 ]; then
           echo -e "\t${CMSG} 8${CEND}. Install php-7.3"
           echo -e "\t${CMSG} 9${CEND}. Install php-7.4"
           echo -e "\t${CMSG}10${CEND}. Install php-8.0"
+          #echo -e "\t${CMSG}11${CEND}. Install php-8.1"
           read -e -p "Please input a number:(Default 7 press Enter) " php_option
           php_option=${php_option:-7}
-          if [[ ! ${php_option} =~ ^[1-9]$|^10$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1~10${CEND}"
+          if [[ ! ${php_option} =~ ^[1-9]$|^1[0-1]$ ]]; then
+            echo "${CWARNING}input error! Please only input number 1~11${CEND}"
           else
             break
           fi
@@ -498,7 +499,7 @@ if [ ${ARG_NUM} == 0 ]; then
   fi
 
   # PHP opcode cache and extensions
-  if [[ ${php_option} =~ ^[1-9]$|^10$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
+  if [[ ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
       read -e -p "Do you want to install opcode cache of the PHP? [y/n]: " phpcache_flag
       if [[ ! ${phpcache_flag} =~ ^[y,n]$ ]]; then
@@ -567,7 +568,7 @@ if [ ${ARG_NUM} == 0 ]; then
               fi
             done
           fi
-          if [[ ${php_option} =~ ^[5-9]$|^10$ ]] || [[ "${PHP_main_ver}" =~ ^7.[0-4]$|^8.0$ ]]; then
+          if [[ ${php_option} =~ ^[5-9]$|^1[0-1]$ ]] || [[ "${PHP_main_ver}" =~ ^7.[0-4]$|^8.[0-1]$ ]]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
               echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
@@ -671,7 +672,7 @@ if [ ${ARG_NUM} == 0 ]; then
   done
 
   # check phpMyAdmin
-  if [[ ${php_option} =~ ^[1-9]$|^10$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
+  if [[ ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
       read -e -p "Do you want to install phpMyAdmin? [y/n]: " phpmyadmin_flag
       if [[ ! ${phpmyadmin_flag} =~ ^[y,n]$ ]]; then
@@ -770,13 +771,9 @@ if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]];
 fi
 
 # openSSL
-if [[ "${tomcat_option}" =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [[ "${php_option}" =~ ^[1-9]$|^10$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]]; then
+if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ "${apache_flag}" == 'y' ] || [[ ${php_option} =~ ^[1-9]$|^1[0-1]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-1]$ ]]; then
   . include/openssl.sh
-  if [[ "${php_option}" =~ ^[1-4]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$ ]]; then
-    Install_openSSL102 | tee -a ${oneinstack_dir}/install.log
-  else
-    Install_openSSL | tee -a ${oneinstack_dir}/install.log
-  fi
+  Install_openSSL | tee -a ${oneinstack_dir}/install.log
 fi
 
 # Database
@@ -908,6 +905,10 @@ case "${php_option}" in
     . include/php-8.0.sh
     Install_PHP80 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
+  11)
+    . include/php-8.1.sh
+    Install_PHP81 2>&1 | tee -a ${oneinstack_dir}/install.log
+    ;;
 esac
 
 PHP_addons() {
@@ -1169,7 +1170,7 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${db_option}" == '14' ] && echo "$(printf "%-32s" "MongoDB data dir:")${CMSG}${mongo_data_dir}${CEND}"
 [ "${db_option}" == '14' ] && echo "$(printf "%-32s" "MongoDB user:")${CMSG}root${CEND}"
 [ "${db_option}" == '14' ] && echo "$(printf "%-32s" "MongoDB password:")${CMSG}${dbmongopwd}${CEND}"
-[[ "${php_option}" =~ ^[1-9]$|^10$ ]] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
+[[ "${php_option}" =~ ^[1-9]$|^1[0-1]$ ]] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
 [ "${phpcache_option}" == '1' ] && echo "$(printf "%-32s" "Opcache Control Panel URL:")${CMSG}http://${IPADDR}/ocp.php${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache Control Panel URL:")${CMSG}http://${IPADDR}/xcache${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache user:")${CMSG}admin${CEND}"

+ 4 - 4
uninstall.sh

@@ -38,7 +38,7 @@ Show_Help() {
   --postgresql                  Uninstall PostgreSQL
   --mongodb                     Uninstall MongoDB
   --php                         Uninstall PHP (PATH: ${php_install_dir})
-  --mphp_ver [53~80]            Uninstall another PHP version (PATH: ${php_install_dir}\${mphp_ver})
+  --mphp_ver [53~81]            Uninstall another PHP version (PATH: ${php_install_dir}\${mphp_ver})
   --allphp                      Uninstall all PHP
   --phpcache                    Uninstall PHP opcode cache
   --php_extensions [ext name]   Uninstall PHP extensions, include zendguardloader,ioncube,
@@ -100,7 +100,7 @@ while :; do
       ;;
     --mphp_ver)
       mphp_ver=$2; mphp_flag=y; shift 2
-      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~80${CEND}"; exit 1; }
+      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-1]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~81${CEND}"; exit 1; }
       ;;
     --allphp)
       allphp_flag=y; shift 1
@@ -288,7 +288,7 @@ Print_ALLPHP() {
   [ -e "${php_install_dir}" ] && echo ${php_install_dir}
   [ -e "/etc/init.d/php-fpm" ] && echo /etc/init.d/php-fpm
   [ -e "/lib/systemd/system/php-fpm.service" ] && echo /lib/systemd/system/php-fpm.service
-  for php_ver in 53 54 55 56 70 71 72 73 74 80; do
+  for php_ver in 53 54 55 56 70 71 72 73 74 80 81; do
     [ -e "${php_install_dir}${php_ver}" ] && echo ${php_install_dir}${php_ver}
     [ -e "/etc/init.d/php${php_ver}-fpm" ] && echo /etc/init.d/php${php_ver}-fpm
     [ -e "/lib/systemd/system/php${php_ver}-fpm.service" ] && echo /lib/systemd/system/php${php_ver}-fpm.service
@@ -320,7 +320,7 @@ Uninstall_ALLPHP() {
   [ -e "${apache_install_dir}/conf/httpd.conf" ] && [ -n "`grep libphp ${apache_install_dir}/conf/httpd.conf`" ] && sed -i '/libphp/d' ${apache_install_dir}/conf/httpd.conf
   [ -e "${php_install_dir}" ] && { rm -rf ${php_install_dir}; echo "${CMSG}PHP uninstall completed! ${CEND}"; }
   sed -i "s@${php_install_dir}/bin:@@" /etc/profile
-  for php_ver in 53 54 55 56 70 71 72 73 74 80; do
+  for php_ver in 53 54 55 56 70 71 72 73 74 80 81; do
     [ -e "/etc/init.d/php${php_ver}-fpm" ] && { service php${php_ver}-fpm stop > /dev/null 2>&1; rm -f /etc/init.d/php${php_ver}-fpm; }
     [ -e "/lib/systemd/system/php${php_ver}-fpm.service" ] && { systemctl stop php${php_ver}-fpm > /dev/null 2>&1; systemctl disable php${php_ver}-fpm > /dev/null 2>&1; rm -f /lib/systemd/system/php${php_ver}-fpm.service; }
     [ -e "${php_install_dir}${php_ver}" ] && { rm -rf ${php_install_dir}${php_ver}; echo "${CMSG}PHP${php_ver} uninstall completed! ${CEND}"; }

+ 14 - 13
versions.txt

@@ -6,13 +6,13 @@ openresty_ver=1.19.9.1
 openssl11_ver=1.1.1k
 openssl_ver=1.0.2u
 
-tomcat10_ver=10.0.10
-tomcat9_ver=9.0.52
-tomcat8_ver=8.5.70
+tomcat10_ver=10.0.11
+tomcat9_ver=9.0.53
+tomcat8_ver=8.5.71
 tomcat7_ver=7.0.109
 
-apache_ver=2.4.48
-pcre_ver=8.44
+apache_ver=2.4.49
+pcre_ver=8.45
 apr_ver=1.7.0
 apr_util_ver=1.6.1
 nghttp2_ver=1.42.0
@@ -51,15 +51,16 @@ php56_ver=5.6.40
 php70_ver=7.0.33
 php71_ver=7.1.33
 php72_ver=7.2.34
-php73_ver=7.3.30
-php74_ver=7.4.23
-php80_ver=8.0.10
+php73_ver=7.3.31
+php74_ver=7.4.24
+php80_ver=8.0.11
+php81_ver=8.1.0RC3
 
 # Nodejs
-node_ver=14.17.1
+node_ver=14.17.6
 
 libiconv_ver=1.16
-curl_ver=7.77.0
+curl_ver=7.79.1
 libmcrypt_ver=2.5.8
 mcrypt_ver=2.6.8
 mhash_ver=0.9.9.9
@@ -68,7 +69,7 @@ icu4c_ver=63_1
 libsodium_ver=1.0.18
 libzip_ver=1.2.0
 argon2_ver=20171227
-imagemagick_ver=7.1.0-6
+imagemagick_ver=7.1.0-8
 imagick_ver=3.5.1
 imagick_oldver=3.4.4
 graphicsmagick_ver=1.3.36
@@ -129,6 +130,6 @@ lua_resty_core_ver=0.1.22
 lua_resty_lrucache_ver=0.11
 lua_cjson_ver=2.1.0.8
 python_ver=3.6.13
-setuptools_ver=57.0.0
-pip_ver=21.2.3
+setuptools_ver=58.0.4
+pip_ver=21.2.4
 fail2ban_ver=0.11.2

+ 6 - 4
vhost.sh

@@ -33,7 +33,7 @@ Show_Help() {
   --help, -h                  Show this help message
   --quiet, -q                 quiet operation
   --list, -l                  List Virtualhost
-  --mphp_ver [53~80]          Use another PHP version (PATH: /usr/local/php${mphp_ver})
+  --mphp_ver [53~81]          Use another PHP version (PATH: /usr/local/php${mphp_ver})
   --proxy                     Use proxy
   --add                       Add Virtualhost
   --delete, --del             Delete Virtualhost
@@ -62,7 +62,7 @@ while :; do
       ;;
     --mphp_ver)
       mphp_ver=$2; mphp_flag=y; shift 2
-      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~80${CEND}"; unset mphp_ver mphp_flag; }
+      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-1]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~81${CEND}"; unset mphp_ver mphp_flag; }
       ;;
     --proxy)
       proxy_flag=y; shift 1
@@ -332,10 +332,11 @@ What Are You Doing?
         [ -e "/dev/shm/php73-cgi.sock" ] && echo -e "\t${CMSG} 8${CEND}. PHP 7.3"
         [ -e "/dev/shm/php74-cgi.sock" ] && echo -e "\t${CMSG} 9${CEND}. PHP 7.4"
         [ -e "/dev/shm/php80-cgi.sock" ] && echo -e "\t${CMSG}10${CEND}. PHP 8.0"
+        [ -e "/dev/shm/php81-cgi.sock" ] && echo -e "\t${CMSG}10${CEND}. PHP 8.1"
         read -e -p "Please input a number:(Default 0 press Enter) " php_option
         php_option=${php_option:-0}
-        if [[ ! ${php_option} =~ ^[0-9]$|^10$ ]]; then
-          echo "${CWARNING}input error! Please only input number 0~10${CEND}"
+        if [[ ! ${php_option} =~ ^[0-9]$|^1[0-1]$ ]]; then
+          echo "${CWARNING}input error! Please only input number 0~11${CEND}"
         else
           break
         fi
@@ -351,6 +352,7 @@ What Are You Doing?
     [ "${php_option}" == '8' ] && mphp_ver=73
     [ "${php_option}" == '9' ] && mphp_ver=74
     [ "${php_option}" == '10' ] && mphp_ver=80
+    [ "${php_option}" == '11' ] && mphp_ver=81
     [ ! -e "/dev/shm/php${mphp_ver}-cgi.sock" ] && unset mphp_ver
   fi