Bladeren bron

Add aarch64

lj2007331@gmail.com 5 jaren geleden
bovenliggende
commit
405ff223a6

+ 26 - 13
README.md

@@ -21,24 +21,37 @@ Script properties:
 - Provide local,remote(rsync between servers),Aliyun OSS,Qcloud COS,UPYUN,QINIU,Amazon S3,Google Drive and Dropbox backup script
 - Provided under HHVM install CentOS 6,7
 
-## How to use
+## Installation
+
+Install the dependencies for your distro, download the source and run the installation script.
+
+#### CentOS/Redhat
 
-If your server system: CentOS/Redhat (Do not enter "//" and "// subsequent sentence)
 ```bash
-yum -y install wget screen   // for CentOS / Redhat
-wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz   // Contains the source code
-tar xzf oneinstack-full.tar.gz
-cd oneinstack   // If you need to modify the directory (installation, data storage, Nginx logs), modify options.conf file
-screen -S oneinstack    // If network interruption, you can execute the command `screen -r oneinstack` reconnect install window
-./install.sh
+yum -y install wget screen
 ```
-If your server system: Debian/Ubuntu (Do not enter "//" and "// subsequent sentence)
+
+#### Debian/Ubuntu
+
 ```bash
-apt-get -y install wget screen   // for Debian / Ubuntu
-wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz   // Contains the source code
+apt-get -y install wget screen
+```
+
+#### Download Source and Install
+
+```bash
+wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz
 tar xzf oneinstack-full.tar.gz
-cd oneinstack    // If you need to modify the directory (installation, data storage, Nginx logs), modify options.conf file
-screen -S oneinstack    // If network interruption, you can execute the command `screen -r oneinstack` reconnect install window
+cd oneinstack 
+```
+
+If you disconnect during installation, you can execute the command `screen -r lnmp` to reconnect to the install window
+```bash
+screen -S oneinstack 
+```
+
+If you need to modify the directory (installation, data storage, Nginx logs), modify `options.conf` file before running install.sh
+```bash
 ./install.sh
 ```
 

+ 1 - 1
include/ZendGuardLoader.sh

@@ -54,7 +54,7 @@ EOF
         echo "${CSUCCESS}PHP ZendGuardLoader module installed successfully! ${CEND}"
       fi
     else
-      echo "Error! Your Apache's prefork or PHP already enable thread safety! "
+      echo "Error! Your Apache's prefork or PHP already enable thread safety or platform ${TARGET_ARCH} does not support ZendGuardLoader! "
     fi
     popd > /dev/null
   fi

+ 24 - 8
include/apache-2.4.sh

@@ -18,8 +18,26 @@ Install_Apache24() {
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
   tar xzf httpd-${apache24_ver}.tar.gz
-  tar xzf apr-${apr_ver}.tar.gz
-  tar xzf apr-util-${apr_util_ver}.tar.gz
+
+  # install apr
+  if [ ! -e "${apr_install_dir}/bin/apr-1-config" ]; then
+    tar xzf apr-${apr_ver}.tar.gz
+    pushd apr-${apr_ver} > /dev/null
+    ./configure --prefix=${apr_install_dir}
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf apr-${apr_ver}
+  fi
+
+  # install apr-util
+  if [ ! -e "${apr_install_dir}/bin/apu-1-config" ]; then
+    tar xzf apr-util-${apr_util_ver}.tar.gz
+    pushd apr-util-${apr_util_ver} > /dev/null
+    ./configure --prefix=${apr_install_dir} --with-apr=${apr_install_dir}
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf apr-util-${apr_util_ver}
+  fi
 
   # install nghttp2
   if [ ! -e "/usr/local/lib/libnghttp2.so" ]; then
@@ -35,15 +53,13 @@ Install_Apache24() {
 
   pushd httpd-${apache24_ver} > /dev/null
   [ ! -d "${apache_install_dir}" ] && mkdir -p ${apache_install_dir}
-  /bin/cp -R ../apr-${apr_ver} ./srclib/apr
-  /bin/cp -R ../apr-util-${apr_util_ver} ./srclib/apr-util
-  LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --enable-mpms-shared=all --with-pcre --with-included-apr --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=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local
   make -j ${THREAD} && make install
   popd > /dev/null
   unset LDFLAGS
   if [ -e "${apache_install_dir}/bin/httpd" ]; then
     echo "${CSUCCESS}Apache installed successfully! ${CEND}"
-    rm -rf httpd-${apache24_ver} pcre-${pcre_ver} apr-${apr_ver} apr-util-${apr_util_ver}
+    rm -rf httpd-${apache24_ver} pcre-${pcre_ver}
   else
     rm -rf ${apache_install_dir}
     echo "${CFAILURE}Apache install failed, Please contact the author! ${CEND}"
@@ -92,10 +108,10 @@ Install_Apache24() {
   sed -i "s@^DocumentRoot.*@DocumentRoot \"${wwwroot_dir}/default\"@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^<Directory \"${apache_install_dir}/htdocs\">@<Directory \"${wwwroot_dir}/default\">@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^#Include conf/extra/httpd-mpm.conf@Include conf/extra/httpd-mpm.conf@" ${apache_install_dir}/conf/httpd.conf
-  if [ "${apache_mpm_option}" == '2' ]; then 
+  if [ "${apache_mpm_option}" == '2' ]; then
     sed -ri 's@^(LoadModule.*mod_mpm_event.so)@#\1@' ${apache_install_dir}/conf/httpd.conf
     sed -i 's@^#LoadModule mpm_prefork_module@LoadModule mpm_prefork_module@' ${apache_install_dir}/conf/httpd.conf
-  elif [ "${apache_mpm_option}" == '3' ]; then 
+  elif [ "${apache_mpm_option}" == '3' ]; then
     sed -ri 's@^(LoadModule.*mod_mpm_event.so)@#\1@' ${apache_install_dir}/conf/httpd.conf
     sed -i 's@^#LoadModule mpm_worker_module@LoadModule mpm_worker_module@' ${apache_install_dir}/conf/httpd.conf
   fi

+ 8 - 7
include/check_download.sh

@@ -729,11 +729,7 @@ checkDownload() {
   # ioncube
   if [ "${pecl_ioncube}" == '1' ]; then
     echo "Download ioncube..."
-    if [ "${TARGET_ARCH}" == "armv7" ]; then
-      src_url=https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz && Download_src
-    else
-      src_url=https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${SYS_BIT_d}.tar.gz && Download_src
-    fi
+    src_url=https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${SYS_BIT_d}.tar.gz && Download_src
   fi
 
   # SourceGuardian
@@ -779,8 +775,13 @@ checkDownload() {
 
   # pecl_redis
   if [ "${pecl_redis}" == '1' ]; then
-    echo "Download pecl_redis..."
-    src_url=https://pecl.php.net/get/redis-${pecl_redis_ver}.tgz && Download_src
+    if [[ "${php_option}" =~ ^[1-4]$ ]]; then
+      echo "Download pecl_redis for php..."
+      src_url=https://pecl.php.net/get/redis-${pecl_redis_oldver}.tgz && Download_src
+    else
+      echo "Download pecl_redis for php 7.x..."
+      src_url=https://pecl.php.net/get/redis-${pecl_redis_ver}.tgz && Download_src
+    fi
   fi
 
   # memcached-server

+ 20 - 15
include/check_os.sh

@@ -10,7 +10,7 @@
 
 if [ -e "/usr/bin/yum" ]; then
   PM=yum
-  command -v lsb_release >/dev/null 2>&1 || { yum -y install redhat-lsb-core; clear; }
+  command -v lsb_release >/dev/null 2>&1 || { [ -e "/etc/euleros-release" ] && yum -y install euleros-lsb || yum -y install redhat-lsb-core; clear; }
 fi
 if [ -e "/usr/bin/apt-get" ]; then
   PM=apt-get
@@ -24,6 +24,7 @@ if [ -e /etc/redhat-release ]; then
   OS=CentOS
   CentOS_ver=$(lsb_release -sr | awk -F. '{print $1}')
   [[ "$(lsb_release -is)" =~ ^Aliyun$|^AlibabaCloudEnterpriseServer$ ]] && { CentOS_ver=7; Aliyun_ver=$(lsb_release -rs); }
+  [[ "$(lsb_release -is)" =~ ^EulerOS$ ]] && { CentOS_ver=7; EulerOS_ver=$(lsb_release -rs); }
   [ "$(lsb_release -is)" == 'Fedora' ] && [ ${CentOS_ver} -ge 19 >/dev/null 2>&1 ] && { CentOS_ver=7; Fedora_ver=$(lsb_release -rs); }
 elif [ -n "$(grep 'Amazon Linux' /etc/issue)" -o -n "$(grep 'Amazon Linux' /etc/os-release)" ]; then
   OS=CentOS
@@ -58,6 +59,22 @@ if [ ${CentOS_ver} -lt 6 >/dev/null 2>&1 ] || [ ${Debian_ver} -lt 8 >/dev/null 2
   kill -9 $$
 fi
 
+LIBC_YN=$(awk -v A=$(getconf -a | grep GNU_LIBC_VERSION | awk '{print $NF}') -v B=2.14 'BEGIN{print(A>=B)?"0":"1"}')
+[ ${LIBC_YN} == '0' ] && GLIBC_FLAG=linux-glibc_214 || GLIBC_FLAG=linux
+
+if uname -m | grep -Eqi "arm|aarch64"; then
+  armplatform="y"
+  if uname -m | grep -Eqi "armv7"; then
+    TARGET_ARCH="armv7"
+  elif uname -m | grep -Eqi "armv8"; then
+    TARGET_ARCH="arm64"
+  elif uname -m | grep -Eqi "aarch64"; then
+    TARGET_ARCH="aarch64"
+  else
+    TARGET_ARCH="unknown"
+  fi
+fi
+
 if [ "$(uname -r | awk -F- '{print $3}' 2>/dev/null)" == "Microsoft" ]; then
   Wsl=true
 fi
@@ -69,6 +86,7 @@ if [ "$(getconf WORD_BIT)" == "32" ] && [ "$(getconf LONG_BIT)" == "64" ]; then
   SYS_BIT_b=x86_64 #mariadb
   SYS_BIT_c=x86_64 #ZendGuardLoader
   SYS_BIT_d=x86-64 #ioncube
+  [ "${TARGET_ARCH}" == 'aarch64' ] && { SYS_BIT_c=aarch64; SYS_BIT_d=aarch64; }
 else
   OS_BIT=32
   SYS_BIT_j=i586
@@ -76,20 +94,7 @@ else
   SYS_BIT_b=i686
   SYS_BIT_c=i386
   SYS_BIT_d=x86
-fi
-
-LIBC_YN=$(awk -v A=$(getconf -a | grep GNU_LIBC_VERSION | awk '{print $NF}') -v B=2.14 'BEGIN{print(A>=B)?"0":"1"}')
-[ ${LIBC_YN} == '0' ] && GLIBC_FLAG=linux-glibc_214 || GLIBC_FLAG=linux
-
-if uname -m | grep -Eqi "arm"; then
-  armplatform="y"
-  if uname -m | grep -Eqi "armv7"; then
-    TARGET_ARCH="armv7"
-  elif uname -m | grep -Eqi "armv8"; then
-    TARGET_ARCH="arm64"
-  else
-    TARGET_ARCH="unknown"
-  fi
+  [ "${TARGET_ARCH}" == 'armv7' ] && { SYS_BIT_c=armhf; SYS_BIT_d=armv7l; }
 fi
 
 THREAD=$(grep 'processor' /proc/cpuinfo | sort -u | wc -l)

+ 1 - 1
include/check_sw.sh

@@ -72,7 +72,7 @@ installDepsCentOS() {
 
   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 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 libxslt-devel libicu-devel libevent-devel libtool libtool-ltdl bison gd-devel vim-enhanced pcre-devel zip unzip ntpdate sqlite-devel sysstat patch bc expect expat-devel 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 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 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 rsync rsyslog git lsof lrzsz psmisc wget which libatomic tmux"
   for Package in ${pkgList}; do
     yum -y install ${Package}
   done

+ 2 - 1
include/init_CentOS.sh

@@ -27,8 +27,9 @@ alias grep='grep --color'
 alias egrep='egrep --color'
 alias fgrep='fgrep --color'
 EOF
+[[ "$(lsb_release -is)" =~ ^EulerOS$ ]] && sed -i '/HISTTIMEFORMAT=/d' /etc/profile.d/oneinstack.sh
 
-[ -z "$(grep ^'PROMPT_COMMAND=' /etc/bashrc)" ] && cat >> /etc/bashrc << EOF
+[[ ! "$(lsb_release -is)" =~ ^EulerOS$ ]] && [ -z "$(grep ^'PROMPT_COMMAND=' /etc/bashrc)" ] && cat >> /etc/bashrc << EOF
 PROMPT_COMMAND='{ msg=\$(history 1 | { read x y; echo \$y; });logger "[euid=\$(whoami)]":\$(who am i):[\`pwd\`]"\$msg"; }'
 EOF
 

+ 1 - 6
include/ioncube.sh

@@ -14,13 +14,8 @@ Install_ionCube() {
     PHP_detail_ver=`${php_install_dir}/bin/php-config --version`
     PHP_main_ver=${PHP_detail_ver%.*}
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-    if  [ "${TARGET_ARCH}" == "armv7" ]; then
-      tar xzf ioncube_loaders_lin_armv7l.tar.gz
-    else
-      tar xzf ioncube_loaders_lin_${SYS_BIT_d}.tar.gz
-    fi
-
     [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
+    [ -e "ioncube_loaders_lin_${SYS_BIT_d}.tar.gz" ] && tar xzf ioncube_loaders_lin_${SYS_BIT_d}.tar.gz
     if [ -z "`echo ${phpExtensionDir} | grep 'non-zts'`" ]; then
       /bin/mv ioncube/ioncube_loader_lin_${PHP_main_ver}_ts.so ${phpExtensionDir}
       zend_extension="${phpExtensionDir}/ioncube_loader_lin_${PHP_main_ver}_ts.so"

+ 16 - 14
include/php-5.3.sh

@@ -46,7 +46,7 @@ Install_PHP53() {
     rm -rf freetype-${freetype_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+  if [ ! -e "/usr/local/bin/libmcrypt-config" -a ! -e "/usr/bin/libmcrypt-config" ]; then
     tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
     pushd libmcrypt-${libmcrypt_ver} > /dev/null
     ./configure
@@ -60,7 +60,7 @@ Install_PHP53() {
     rm -rf libmcrypt-${libmcrypt_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -73,22 +73,24 @@ Install_PHP53() {
   ldconfig
 
   if [ "${PM}" == 'yum' ]; then
-    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    [ ! -e "/usr/bin/libmcrypt-config" ] && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
-  tar xzf mcrypt-${mcrypt_ver}.tar.gz
-  pushd mcrypt-${mcrypt_ver} > /dev/null
-  ldconfig
-  ./configure
-  make -j ${THREAD} && make install
-  popd > /dev/null
-  rm -rf mcrypt-${mcrypt_ver}
+  if [ ! -e "/usr/local/bin/mcrypt" -a ! -e "/usr/bin/mcrypt" ]; then
+    tar xzf mcrypt-${mcrypt_ver}.tar.gz
+    pushd mcrypt-${mcrypt_ver} > /dev/null
+    ldconfig
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mcrypt-${mcrypt_ver}
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -156,7 +158,7 @@ Install_PHP53() {
   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 = 5@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
+  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
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then

+ 16 - 14
include/php-5.4.sh

@@ -46,7 +46,7 @@ Install_PHP54() {
     rm -rf freetype-${freetype_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+  if [ ! -e "/usr/local/bin/libmcrypt-config" -a ! -e "/usr/bin/libmcrypt-config" ]; then
     tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
     pushd libmcrypt-${libmcrypt_ver} > /dev/null
     ./configure
@@ -60,7 +60,7 @@ Install_PHP54() {
     rm -rf libmcrypt-${libmcrypt_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -73,22 +73,24 @@ Install_PHP54() {
   ldconfig
 
   if [ "${PM}" == 'yum' ]; then
-    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    [ ! -e "/usr/bin/libmcrypt-config" ] && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
-  tar xzf mcrypt-${mcrypt_ver}.tar.gz
-  pushd mcrypt-${mcrypt_ver} > /dev/null
-  ldconfig
-  ./configure
-  make -j ${THREAD} && make install
-  popd > /dev/null
-  rm -rf mcrypt-${mcrypt_ver}
+  if [ ! -e "/usr/local/bin/mcrypt" -a ! -e "/usr/bin/mcrypt" ]; then
+    tar xzf mcrypt-${mcrypt_ver}.tar.gz
+    pushd mcrypt-${mcrypt_ver} > /dev/null
+    ldconfig
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mcrypt-${mcrypt_ver}
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -153,7 +155,7 @@ Install_PHP54() {
   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 = 5@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
+  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
 
   if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then

+ 16 - 14
include/php-5.5.sh

@@ -46,7 +46,7 @@ Install_PHP55() {
     rm -rf freetype-${freetype_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+  if [ ! -e "/usr/local/bin/libmcrypt-config" -a ! -e "/usr/bin/libmcrypt-config" ]; then
     tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
     pushd libmcrypt-${libmcrypt_ver} > /dev/null
     ./configure
@@ -60,7 +60,7 @@ Install_PHP55() {
     rm -rf libmcrypt-${libmcrypt_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -73,22 +73,24 @@ Install_PHP55() {
   ldconfig
 
   if [ "${PM}" == 'yum' ]; then
-    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    [ ! -e "/usr/bin/libmcrypt-config" ] && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
-  tar xzf mcrypt-${mcrypt_ver}.tar.gz
-  pushd mcrypt-${mcrypt_ver} > /dev/null
-  ldconfig
-  ./configure
-  make -j ${THREAD} && make install
-  popd > /dev/null
-  rm -rf mcrypt-${mcrypt_ver}
+  if [ ! -e "/usr/local/bin/mcrypt" -a ! -e "/usr/bin/mcrypt" ]; then
+    tar xzf mcrypt-${mcrypt_ver}.tar.gz
+    pushd mcrypt-${mcrypt_ver} > /dev/null
+    ldconfig
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mcrypt-${mcrypt_ver}
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -152,7 +154,7 @@ Install_PHP55() {
   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 = 5@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
+  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
 
   [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF

+ 16 - 14
include/php-5.6.sh

@@ -46,7 +46,7 @@ Install_PHP56() {
     rm -rf freetype-${freetype_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+  if [ ! -e "/usr/local/bin/libmcrypt-config" -a ! -e "/usr/bin/libmcrypt-config" ]; then
     tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
     pushd libmcrypt-${libmcrypt_ver} > /dev/null
     ./configure
@@ -60,7 +60,7 @@ Install_PHP56() {
     rm -rf libmcrypt-${libmcrypt_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -73,22 +73,24 @@ Install_PHP56() {
   ldconfig
 
   if [ "${PM}" == 'yum' ]; then
-    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    [ ! -e "/usr/bin/libmcrypt-config" ] && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
-  tar xzf mcrypt-${mcrypt_ver}.tar.gz
-  pushd mcrypt-${mcrypt_ver} > /dev/null
-  ldconfig
-  ./configure
-  make -j ${THREAD} && make install
-  popd > /dev/null
-  rm -rf mcrypt-${mcrypt_ver}
+  if [ ! -e "/usr/local/bin/mcrypt" -a ! -e "/usr/bin/mcrypt" ]; then
+    tar xzf mcrypt-${mcrypt_ver}.tar.gz
+    pushd mcrypt-${mcrypt_ver} > /dev/null
+    ldconfig
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mcrypt-${mcrypt_ver}
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -153,7 +155,7 @@ Install_PHP56() {
   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 = 5@' ${php_install_dir}/etc/php.ini
-  sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
+  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

+ 16 - 14
include/php-7.0.sh

@@ -46,7 +46,7 @@ Install_PHP70() {
     rm -rf freetype-${freetype_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+  if [ ! -e "/usr/local/bin/libmcrypt-config" -a ! -e "/usr/bin/libmcrypt-config" ]; then
     tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
     pushd libmcrypt-${libmcrypt_ver} > /dev/null
     ./configure
@@ -60,7 +60,7 @@ Install_PHP70() {
     rm -rf libmcrypt-${libmcrypt_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -73,22 +73,24 @@ Install_PHP70() {
   ldconfig
 
   if [ "${PM}" == 'yum' ]; then
-    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    [ ! -e "/usr/bin/libmcrypt-config" ] && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
-  tar xzf mcrypt-${mcrypt_ver}.tar.gz
-  pushd mcrypt-${mcrypt_ver} > /dev/null
-  ldconfig
-  ./configure
-  make -j ${THREAD} && make install
-  popd > /dev/null
-  rm -rf mcrypt-${mcrypt_ver}
+  if [ ! -e "/usr/local/bin/mcrypt" -a ! -e "/usr/bin/mcrypt" ]; then
+    tar xzf mcrypt-${mcrypt_ver}.tar.gz
+    pushd mcrypt-${mcrypt_ver} > /dev/null
+    ldconfig
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mcrypt-${mcrypt_ver}
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -154,7 +156,7 @@ Install_PHP70() {
   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
+  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

+ 16 - 14
include/php-7.1.sh

@@ -46,7 +46,7 @@ Install_PHP71() {
     rm -rf freetype-${freetype_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmcrypt.la" ]; then
+  if [ ! -e "/usr/local/bin/libmcrypt-config" -a ! -e "/usr/bin/libmcrypt-config" ]; then
     tar xzf libmcrypt-${libmcrypt_ver}.tar.gz
     pushd libmcrypt-${libmcrypt_ver} > /dev/null
     ./configure
@@ -60,7 +60,7 @@ Install_PHP71() {
     rm -rf libmcrypt-${libmcrypt_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -73,22 +73,24 @@ Install_PHP71() {
   ldconfig
 
   if [ "${PM}" == 'yum' ]; then
-    ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
+    [ ! -e "/usr/bin/libmcrypt-config" ] && ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
-  tar xzf mcrypt-${mcrypt_ver}.tar.gz
-  pushd mcrypt-${mcrypt_ver} > /dev/null
-  ldconfig
-  ./configure
-  make -j ${THREAD} && make install
-  popd > /dev/null
-  rm -rf mcrypt-${mcrypt_ver}
+  if [ ! -e "/usr/local/bin/mcrypt" -a ! -e "/usr/bin/mcrypt" ]; then
+    tar xzf mcrypt-${mcrypt_ver}.tar.gz
+    pushd mcrypt-${mcrypt_ver} > /dev/null
+    ldconfig
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mcrypt-${mcrypt_ver}
+  fi
 
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
@@ -153,7 +155,7 @@ Install_PHP71() {
   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
+  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

+ 5 - 5
include/php-7.2.sh

@@ -63,7 +63,7 @@ Install_PHP72() {
     rm -rf libsodium-${libsodium_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -77,10 +77,10 @@ Install_PHP72() {
 
   if [ "${PM}" == 'yum' ]; then
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
@@ -147,7 +147,7 @@ Install_PHP72() {
   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
+  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

+ 5 - 5
include/php-7.3.sh

@@ -63,7 +63,7 @@ Install_PHP73() {
     rm -rf libsodium-${libsodium_ver}
   fi
 
-  if [ ! -e "/usr/local/lib/libmhash.la" ]; then
+  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
@@ -77,10 +77,10 @@ Install_PHP73() {
 
   if [ "${PM}" == 'yum' ]; then
     if [ "${OS_BIT}" == '64' ]; then
-      ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
-      ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+      [ ! -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
-      ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
     fi
   fi
 
@@ -147,7 +147,7 @@ Install_PHP73() {
   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
+  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

+ 8 - 3
include/redis.sh

@@ -61,8 +61,13 @@ Install_pecl_redis() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-    tar xzf redis-${pecl_redis_ver}.tgz
-    pushd redis-${pecl_redis_ver} > /dev/null
+    if [ "`${php_install_dir}/bin/php-config --version | awk -F. '{print $1}'`" == '7' ]; then
+      tar xzf redis-${pecl_redis_ver}.tgz
+      pushd redis-${pecl_redis_ver} > /dev/null
+    else
+      tar xzf redis-${pecl_redis_oldver}.tgz
+      pushd redis-${pecl_redis_oldver} > /dev/null
+    fi
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config
     make -j ${THREAD} && make install
@@ -70,7 +75,7 @@ Install_pecl_redis() {
     if [ -f "${phpExtensionDir}/redis.so" ]; then
       echo 'extension=redis.so' > ${php_install_dir}/etc/php.d/05-redis.ini
       echo "${CSUCCESS}PHP Redis module installed successfully! ${CEND}"
-      rm -rf redis-${pecl_redis_ver}
+      rm -rf redis-${pecl_redis_ver} redis-${pecl_redis_oldver}
     else
       echo "${CFAILURE}PHP Redis module install failed, Please contact the author! ${CEND}"
     fi

+ 4 - 7
include/sourceguardian.sh

@@ -14,13 +14,10 @@ Install_SourceGuardian() {
     PHP_detail_ver=`${php_install_dir}/bin/php-config --version`
     PHP_main_ver=${PHP_detail_ver%.*}
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-    if [[ "${PHP_main_ver}" =~ ^5.[3-6]$|^7.[0-2]$ ]] || [ "${TARGET_ARCH}" == "armv8" ]; then
-      [ ! -e sourceguardian ] && mkdir sourceguardian
-      if  [ "${TARGET_ARCH}" == "armv8" ]; then
-        tar xzf loaders.linux-aarch64.tar.gz -C sourceguardian
-      else
-        tar xzf loaders.linux-${SYS_BIT_c}.tar.gz -C sourceguardian
-      fi
+    [ ! -e sourceguardian ] && mkdir sourceguardian
+    [ -e "loaders.linux-${SYS_BIT_c}.tar.gz" ] && tar xzf loaders.linux-${SYS_BIT_c}.tar.gz -C sourceguardian
+  
+    if [ -e "sourceguardian/ixed.${PHP_main_ver}.lin" ]; then
       [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
       if [ -z "`echo ${phpExtensionDir} | grep 'non-zts'`" ]; then
         /bin/mv sourceguardian/ixed.${PHP_main_ver}ts.lin ${phpExtensionDir}

+ 5 - 5
include/tomcat-6.sh

@@ -15,10 +15,10 @@ Install_Tomcat6() {
   [ $? -ne 0 ] && useradd -M -s /bin/bash ${run_user} || { [ -z "$(grep ^${run_user} /etc/passwd | grep '/bin/bash')" ] && usermod -s /bin/bash ${run_user}; }
 
   # install apr
-  if [ ! -e "/usr/local/apr/bin/apr-1-config" ]; then
+  if [ ! -e "${apr_install_dir}/bin/apr-1-config" ]; then
     tar xzf apr-${apr_ver}.tar.gz
     pushd apr-${apr_ver} > /dev/null
-    ./configure
+    ./configure --prefix=${apr_install_dir}
     make -j ${THREAD} && make install
     popd > /dev/null
     rm -rf apr-${apr_ver}
@@ -49,16 +49,16 @@ Install_Tomcat6() {
   pushd ${tomcat_install_dir}/bin > /dev/null
   tar xzf tomcat-native.tar.gz
   pushd tomcat-native-*-src/native > /dev/null
-    ./configure --with-apr=/usr/local/apr --with-ssl=${openssl_install_dir}
+    ./configure --with-apr=${apr_install_dir} --with-ssl=${openssl_install_dir}
     make -j ${THREAD} && make install
   popd > /dev/null
   rm -rf tomcat-native-*
-  if [ -e "/usr/local/apr/lib/libtcnative-1.la" ]; then
+  if [ -e "${apr_install_dir}/lib/libtcnative-1.la" ]; then
     [ ${Mem} -le 768 ] && let Xms_Mem="${Mem}/3" || Xms_Mem=256
     let XmxMem="${Mem}/2"
     cat > ${tomcat_install_dir}/bin/setenv.sh << EOF
 JAVA_OPTS='-Djava.security.egd=file:/dev/./urandom -server -Xms${Xms_Mem}m -Xmx${XmxMem}m -Dfile.encoding=UTF-8'
-CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
+CATALINA_OPTS="-Djava.library.path=${apr_install_dir}/lib"
 # -Djava.rmi.server.hostname=$IPADDR
 # -Dcom.sun.management.jmxremote.password.file=\$CATALINA_BASE/conf/jmxremote.password
 # -Dcom.sun.management.jmxremote.access.file=\$CATALINA_BASE/conf/jmxremote.access

+ 5 - 5
include/tomcat-7.sh

@@ -15,10 +15,10 @@ Install_Tomcat7() {
   [ $? -ne 0 ] && useradd -M -s /bin/bash ${run_user} || { [ -z "$(grep ^${run_user} /etc/passwd | grep '/bin/bash')" ] && usermod -s /bin/bash ${run_user}; }
 
   # install apr
-  if [ ! -e "/usr/local/apr/bin/apr-1-config" ]; then
+  if [ ! -e "${apr_install_dir}/bin/apr-1-config" ]; then
     tar xzf apr-${apr_ver}.tar.gz
     pushd apr-${apr_ver} > /dev/null
-    ./configure
+    ./configure --prefix=${apr_install_dir}
     make -j ${THREAD} && make install
     popd > /dev/null
     rm -rf apr-${apr_ver}
@@ -49,16 +49,16 @@ Install_Tomcat7() {
   pushd ${tomcat_install_dir}/bin > /dev/null
   tar xzf tomcat-native.tar.gz
   pushd tomcat-native-*-src/native > /dev/null
-    ./configure --with-apr=/usr/local/apr --with-ssl=${openssl_install_dir}
+    ./configure --with-apr=${apr_install_dir} --with-ssl=${openssl_install_dir}
     make -j ${THREAD} && make install
   popd > /dev/null
   rm -rf tomcat-native-*
-  if [ -e "/usr/local/apr/lib/libtcnative-1.la" ]; then
+  if [ -e "${apr_install_dir}/lib/libtcnative-1.la" ]; then
     [ ${Mem} -le 768 ] && let Xms_Mem="${Mem}/3" || Xms_Mem=256
     let XmxMem="${Mem}/2"
     cat > ${tomcat_install_dir}/bin/setenv.sh << EOF
 JAVA_OPTS='-Djava.security.egd=file:/dev/./urandom -server -Xms${Xms_Mem}m -Xmx${XmxMem}m -Dfile.encoding=UTF-8'
-CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
+CATALINA_OPTS="-Djava.library.path=${apr_install_dir}/lib"
 # -Djava.rmi.server.hostname=$IPADDR
 # -Dcom.sun.management.jmxremote.password.file=\$CATALINA_BASE/conf/jmxremote.password
 # -Dcom.sun.management.jmxremote.access.file=\$CATALINA_BASE/conf/jmxremote.access

+ 5 - 5
include/tomcat-8.sh

@@ -15,10 +15,10 @@ Install_Tomcat8() {
   [ $? -ne 0 ] && useradd -M -s /bin/bash ${run_user} || { [ -z "$(grep ^${run_user} /etc/passwd | grep '/bin/bash')" ] && usermod -s /bin/bash ${run_user}; }
 
   # install apr
-  if [ ! -e "/usr/local/apr/bin/apr-1-config" ]; then
+  if [ ! -e "${apr_install_dir}/bin/apr-1-config" ]; then
     tar xzf apr-${apr_ver}.tar.gz
     pushd apr-${apr_ver} > /dev/null
-    ./configure
+    ./configure --prefix=${apr_install_dir}
     make -j ${THREAD} && make install
     popd > /dev/null
     rm -rf apr-${apr_ver}
@@ -49,16 +49,16 @@ Install_Tomcat8() {
   pushd ${tomcat_install_dir}/bin > /dev/null
   tar xzf tomcat-native.tar.gz
   pushd tomcat-native-*-src/native > /dev/null
-    ./configure --with-apr=/usr/local/apr --with-ssl=${openssl_install_dir}
+    ./configure --with-apr=${apr_install_dir} --with-ssl=${openssl_install_dir}
     make -j ${THREAD} && make install
   popd > /dev/null
   rm -rf tomcat-native-*
-  if [ -e "/usr/local/apr/lib/libtcnative-1.la" ]; then
+  if [ -e "${apr_install_dir}/lib/libtcnative-1.la" ]; then
     [ ${Mem} -le 768 ] && let Xms_Mem="${Mem}/3" || Xms_Mem=256
     let XmxMem="${Mem}/2"
     cat > ${tomcat_install_dir}/bin/setenv.sh << EOF
 JAVA_OPTS='-Djava.security.egd=file:/dev/./urandom -server -Xms${Xms_Mem}m -Xmx${XmxMem}m -Dfile.encoding=UTF-8'
-CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
+CATALINA_OPTS="-Djava.library.path=${apr_install_dir}/lib"
 # -Djava.rmi.server.hostname=$IPADDR
 # -Dcom.sun.management.jmxremote.password.file=\$CATALINA_BASE/conf/jmxremote.password
 # -Dcom.sun.management.jmxremote.access.file=\$CATALINA_BASE/conf/jmxremote.access

+ 5 - 5
include/tomcat-9.sh

@@ -15,10 +15,10 @@ Install_Tomcat9() {
   [ $? -ne 0 ] && useradd -M -s /bin/bash ${run_user} || { [ -z "$(grep ^${run_user} /etc/passwd | grep '/bin/bash')" ] && usermod -s /bin/bash ${run_user}; }
 
   # install apr
-  if [ ! -e "/usr/local/apr/bin/apr-1-config" ]; then
+  if [ ! -e "${apr_install_dir}/bin/apr-1-config" ]; then
     tar xzf apr-${apr_ver}.tar.gz
     pushd apr-${apr_ver} > /dev/null
-    ./configure
+    ./configure --prefix=${apr_install_dir}
     make -j ${THREAD} && make install
     popd > /dev/null
     rm -rf apr-${apr_ver}
@@ -48,16 +48,16 @@ Install_Tomcat9() {
   pushd ${tomcat_install_dir}/bin > /dev/null
   tar xzf tomcat-native.tar.gz
   pushd tomcat-native-*-src/native > /dev/null
-    ./configure --with-apr=/usr/local/apr --with-ssl=${openssl_install_dir}
+    ./configure --with-apr=${apr_install_dir} --with-ssl=${openssl_install_dir}
     make -j ${THREAD} && make install
   popd > /dev/null
   rm -rf tomcat-native-*
-  if [ -e "/usr/local/apr/lib/libtcnative-1.la" ]; then
+  if [ -e "${apr_install_dir}/lib/libtcnative-1.la" ]; then
     [ ${Mem} -le 768 ] && let Xms_Mem="${Mem}/3" || Xms_Mem=256
     let XmxMem="${Mem}/2"
     cat > ${tomcat_install_dir}/bin/setenv.sh << EOF
 JAVA_OPTS='-Djava.security.egd=file:/dev/./urandom -server -Xms${Xms_Mem}m -Xmx${XmxMem}m -Dfile.encoding=UTF-8'
-CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
+CATALINA_OPTS="-Djava.library.path=${apr_install_dir}/lib"
 # -Djava.rmi.server.hostname=$IPADDR
 # -Dcom.sun.management.jmxremote.password.file=\$CATALINA_BASE/conf/jmxremote.password
 # -Dcom.sun.management.jmxremote.access.file=\$CATALINA_BASE/conf/jmxremote.access

+ 22 - 6
include/upgrade_web.sh

@@ -212,8 +212,6 @@ Upgrade_Apache() {
         if [ "${Apache_main_ver}" == '24' ]; then
           src_url=http://archive.apache.org/dist/apr/apr-${apr_ver}.tar.gz && Download_src
           src_url=http://archive.apache.org/dist/apr/apr-util-${apr_util_ver}.tar.gz && Download_src
-          tar xzf apr-${apr_ver}.tar.gz
-          tar xzf apr-util-${apr_util_ver}.tar.gz
         fi
         [ ! -e "httpd-${NEW_apache_ver}.tar.gz" ] && wget --no-check-certificate -c http://archive.apache.org/dist/httpd/httpd-${NEW_apache_ver}.tar.gz > /dev/null 2>&1
         if [ -e "httpd-${NEW_apache_ver}.tar.gz" ]; then
@@ -237,13 +235,31 @@ Upgrade_Apache() {
       echo "Press Ctrl+c to cancel or Press any key to continue..."
       char=`get_char`
     fi
+    if [ "${Apache_main_ver}" == '24' ]; then
+      # install apr
+      if [ ! -e "${apr_install_dir}/bin/apr-1-config" ]; then
+        tar xzf apr-${apr_ver}.tar.gz
+        pushd apr-${apr_ver} > /dev/null
+        ./configure --prefix=${apr_install_dir}
+        make -j ${THREAD} && make install
+        popd > /dev/null
+        rm -rf apr-${apr_ver}
+      fi
+      # install apr-util
+      if [ ! -e "${apr_install_dir}/bin/apu-1-config" ]; then
+        tar xzf apr-util-${apr_util_ver}.tar.gz
+        pushd apr-util-${apr_util_ver} > /dev/null
+        ./configure --prefix=${apr_install_dir} --with-apr=${apr_install_dir}
+        make -j ${THREAD} && make install
+        popd > /dev/null
+        rm -rf apr-util-${apr_util_ver}
+      fi
+    fi
     tar xzf httpd-${NEW_apache_ver}.tar.gz
     pushd httpd-${NEW_apache_ver}
     make clean
     if [ "${Apache_main_ver}" == '24' ]; then
-      /bin/cp -R ../apr-${apr_ver} ./srclib/apr
-      /bin/cp -R ../apr-util-${apr_util_ver} ./srclib/apr-util
-      LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --enable-mpms-shared=all --with-pcre --with-included-apr --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=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local
     elif [ "${Apache_main_ver}" == '22' ]; then
       LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --with-mpm=prefork --enable-mpms-shared=all --with-included-apr --enable-headers --enable-mime-magic --enable-deflate --enable-proxy --enable-so --enable-dav --enable-rewrite --enable-expires --enable-static-support --enable-suexec --with-expat=builtin --enable-mods-shared=most --enable-ssl --with-ssl=${openssl_install_dir}
     fi
@@ -256,7 +272,7 @@ Upgrade_Apache() {
       service httpd start
       popd > /dev/null
       echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}${OLD_apache_ver}${CEND} to ${CWARNING}${NEW_apache_ver}${CEND}"
-      rm -rf httpd-${NEW_apache_ver} apr-${apr_ver} apr-util-${apr_util_ver}
+      rm -rf httpd-${NEW_apache_ver}
     else
       echo "${CFAILURE}Upgrade Apache failed! ${CEND}"
     fi

+ 2 - 0
options.conf

@@ -34,6 +34,8 @@ gmagick_install_dir=/usr/local/graphicsmagick
 curl_install_dir=/usr/local/curl
 freetype_install_dir=/usr/local/freetype
 
+apr_install_dir=/usr/local/apr
+
 # Add modules
 nginx_modules_options=''
 php_modules_options=''

+ 3 - 2
uninstall.sh

@@ -191,7 +191,7 @@ Print_web() {
   [ -e "/etc/init.d/tomcat" ] && echo /etc/init.d/tomcat
   [ -e "/etc/logrotate.d/tomcat" ] && echo /etc/logrotate.d/tomcat
   [ -d "/usr/java" ] && echo /usr/java
-  [ -d "/usr/local/apr" ] && echo /usr/local/apr
+  [ -d "${apr_install_dir}" ] && echo ${apr_install_dir}
 }
 
 Uninstall_Web() {
@@ -201,11 +201,12 @@ Uninstall_Web() {
   [ -e "/lib/systemd/system/nginx.service" ] && { systemctl disable nginx > /dev/null 2>&1; rm -f /lib/systemd/system/nginx.service; }
   [ -d "${apache_install_dir}" ] && { service httpd stop > /dev/null 2>&1; rm -rf ${apache_install_dir} /etc/init.d/httpd /etc/logrotate.d/apache; sed -i "s@${apache_install_dir}/bin:@@" /etc/profile; echo "${CMSG}Apache uninstall completed! ${CEND}"; }
   [ -e "/lib/systemd/system/httpd.service" ] && { systemctl disable httpd > /dev/null 2>&1; rm -f /lib/systemd/system/httpd.service; }
-  [ -d "${tomcat_install_dir}" ] && { killall java > /dev/null 2>&1; chmod +x /etc/logrotate.d/tomcat; rm -rf ${tomcat_install_dir} /etc/init.d/tomcat /etc/logrotate.d/tomcat /usr/local/apr; echo "${CMSG}Tomcat uninstall completed! ${CEND}"; }
+  [ -d "${tomcat_install_dir}" ] && { killall java > /dev/null 2>&1; chmod +x /etc/logrotate.d/tomcat; rm -rf ${tomcat_install_dir} /etc/init.d/tomcat /etc/logrotate.d/tomcat; echo "${CMSG}Tomcat uninstall completed! ${CEND}"; }
   [ -d "/usr/java" ] && { rm -rf /usr/java; sed -i '/export JAVA_HOME=/d' /etc/profile; sed -i '/export CLASSPATH=/d' /etc/profile; sed -i 's@\$JAVA_HOME/bin:@@' /etc/profile; }
   [ -e "${wwwroot_dir}" ] && /bin/mv ${wwwroot_dir}{,$(date +%Y%m%d%H)}
   sed -i 's@^website_name=.*@website_name=@' ./options.conf
   sed -i 's@^backup_content=.*@backup_content=@' ./options.conf
+  [ -d "${apr_install_dir}" ] && rm -rf ${apr_install_dir}
 }
 
 Print_MySQL() {

+ 20 - 19
versions.txt

@@ -1,14 +1,14 @@
 # newest software version
 # Web
 nginx_ver=1.16.0
-tengine_ver=2.3.0
+tengine_ver=2.3.1
 openresty_ver=1.15.8.1
 openssl11_ver=1.1.1c
 openssl_ver=1.0.2s
 
-tomcat9_ver=9.0.21
-tomcat8_ver=8.5.42
-tomcat7_ver=7.0.94
+tomcat9_ver=9.0.22
+tomcat8_ver=8.5.43
+tomcat7_ver=7.0.96
 tomcat6_ver=6.0.53
 
 apache24_ver=2.4.39
@@ -19,15 +19,15 @@ apr_util_ver=1.6.1
 nghttp2_ver=1.39.1
 
 # DB
-mysql80_ver=8.0.16
-mysql57_ver=5.7.26
-mysql56_ver=5.6.44
+mysql80_ver=8.0.17
+mysql57_ver=5.7.27
+mysql56_ver=5.6.45
 mysql55_ver=5.5.62
 
-mariadb104_ver=10.4.6
-mariadb103_ver=10.3.16
-mariadb102_ver=10.2.25
-mariadb55_ver=5.5.64
+mariadb104_ver=10.4.7
+mariadb103_ver=10.3.17
+mariadb102_ver=10.2.26
+mariadb55_ver=5.5.65
 
 percona80_ver=8.0.15-6
 percona57_ver=5.7.26-29
@@ -36,20 +36,20 @@ percona55_ver=5.5.62-38.14
 
 alisql_ver=5.6.32-9
 
-pgsql_ver=11.4
+pgsql_ver=11.5
 
 mongodb_ver=4.0.10
 
 # JDK
-jdk110_ver=11.0.3
-jdk18_ver=1.8.0_212
+jdk110_ver=11.0.4
+jdk18_ver=1.8.0_221
 jdk17_ver=1.7.0_80
 jdk16_ver=1.6.0_45
 
 # PHP
-php73_ver=7.3.7
-php72_ver=7.2.20
-php71_ver=7.1.30
+php73_ver=7.3.8
+php72_ver=7.2.21
+php71_ver=7.1.31
 php70_ver=7.0.33
 php56_ver=5.6.40
 php55_ver=5.5.38
@@ -78,7 +78,7 @@ eaccelerator_ver=0.9.6.1
 phalcon_ver=3.4.3
 yaf_ver=3.0.8
 yar_ver=2.0.5
-swoole_ver=4.4.0
+swoole_ver=4.4.3
 swoole_oldver=1.10.5
 xdebug_ver=2.7.2
 xdebug_oldver=2.5.5
@@ -88,7 +88,8 @@ pureftpd_ver=1.0.49
 
 # Redis
 redis_ver=5.0.5
-pecl_redis_ver=4.3.0
+pecl_redis_ver=5.0.2
+pecl_redis_oldver=4.3.0
 
 # Memcached
 memcached_ver=1.5.16