Преглед на файлове

Fix ZendGuardLoader bug

lj2007331@gmail.com преди 7 години
родител
ревизия
4af3dbd717

+ 54 - 62
addons.sh

@@ -63,7 +63,7 @@ fi
 # Check PHP Extensions
 Check_PHP_Extension() {
   [ ! -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP was not exist! ${CEND}"; exit 1; } 
-  [ -e "${php_install_dir}/etc/php.d/ext-${PHP_extension}.ini" ] && { echo "${CWARNING}PHP ${PHP_extension} module already installed! ${CEND}"; exit 1; }
+  [ -e "`ls ${php_install_dir}/etc/php.d/0?-${PHP_extension}.ini 2> /dev/null`" ] && { echo "${CWARNING}PHP ${PHP_extension} module already installed! ${CEND}"; exit 1; }
 }
 
 # restart PHP
@@ -78,7 +78,7 @@ Check_succ() {
 
 # Uninstall succ
 Uninstall_succ() {
-  [ -e "${php_install_dir}/etc/php.d/ext-${PHP_extension}.ini" ] && { rm -rf ${php_install_dir}/etc/php.d/ext-${PHP_extension}.ini; Restart_PHP; echo; echo "${CMSG}PHP ${PHP_extension} module uninstall completed${CEND}"; } || { echo; echo "${CWARNING}${PHP_extension} module does not exist! ${CEND}"; }
+  [ -e "`ls ${php_install_dir}/etc/php.d/0?-${PHP_extension}.ini 2> /dev/null`" ] && { rm -rf ${php_install_dir}/etc/php.d/0?-${PHP_extension}.ini; Restart_PHP; echo; echo "${CMSG}PHP ${PHP_extension} module uninstall completed${CEND}"; } || { echo; echo "${CWARNING}${PHP_extension} module does not exist! ${CEND}"; }
 }
 
 Install_letsencrypt() {
@@ -234,55 +234,51 @@ What Are You Doing?
         done
         if [ "${ACTION}" = '1' ]; then
           Check_PHP_Extension
-          if [ -e ${php_install_dir}/etc/php.d/ext-ZendGuardLoader.ini ]; then
-            echo; echo "${CWARNING}You have to install ZendGuardLoader, You need to uninstall it before install ${PHP_extension}! ${CEND}"; echo; exit 1
-          else
-            case "${phpcache_option}" in
-              1)
-                pushd ${oneinstack_dir}/src > /dev/null
-                if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
-                  src_url=https://pecl.php.net/get/zendopcache-${zendopcache_ver}.tgz && Download_src
-                  Install_ZendOPcache
-                else
-                  src_url=http://www.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
-                  Install_ZendOPcache
-                fi
-                popd
+          case "${phpcache_option}" in
+            1)
+              pushd ${oneinstack_dir}/src > /dev/null
+              if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
+                src_url=https://pecl.php.net/get/zendopcache-${zendopcache_ver}.tgz && Download_src
+                Install_ZendOPcache
+              else
+                src_url=http://www.php.net/distributions/php-${PHP_detail_ver}.tar.gz && Download_src
+                Install_ZendOPcache
+              fi
+              popd
+              Check_succ
+              ;;
+            2)
+              if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]]; then
+                while :; do
+                  read -p "Please input xcache admin password: " xcache_admin_pass
+                  (( ${#xcache_admin_pass} >= 5 )) && { xcache_admin_md5_pass=$(echo -n "${xcache_admin_pass}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
+                done
+                checkDownload
+                Install_XCache
                 Check_succ
-                ;;
-              2)
-                if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]]; then
-                  while :; do
-                    read -p "Please input xcache admin password: " xcache_admin_pass
-                    (( ${#xcache_admin_pass} >= 5 )) && { xcache_admin_md5_pass=$(echo -n "${xcache_admin_pass}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
-                  done
-                  checkDownload
-                  Install_XCache
-                  Check_succ
-                else
-                  echo "${CWARNING}Your php does not support XCache! ${CEND}"; exit 1
-                fi
-                ;;
-              3)
-                if [[ "${PHP_main_ver}" =~ ^5.[3-6]$|^7.[0-2]$ ]]; then
-                  checkDownload
-                  Install_APCU
-                  Check_succ
-                else
-                  echo "${CWARNING}Your php does not support APCU! ${CEND}"; exit 1
-                fi
-                ;;
-              4)
-                if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
-                  checkDownload
-                  Install_eAccelerator
-                  Check_succ
-                else
-                  echo "${CWARNING}Your php does not support eAccelerator! ${CEND}"; exit 1
-                fi
-                ;;
-            esac
-          fi
+              else
+                echo "${CWARNING}Your php does not support XCache! ${CEND}"; exit 1
+              fi
+              ;;
+            3)
+              if [[ "${PHP_main_ver}" =~ ^5.[3-6]$|^7.[0-2]$ ]]; then
+                checkDownload
+                Install_APCU
+                Check_succ
+              else
+                echo "${CWARNING}Your php does not support APCU! ${CEND}"; exit 1
+              fi
+              ;;
+            4)
+              if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
+                checkDownload
+                Install_eAccelerator
+                Check_succ
+              else
+                echo "${CWARNING}Your php does not support eAccelerator! ${CEND}"; exit 1
+              fi
+              ;;
+          esac
         else
           Uninstall_succ
         fi
@@ -299,21 +295,17 @@ What Are You Doing?
             echo "${CWARNING}input error! Please only input number 1~2${CEND}"
           else
             [ "${Loader}" = '1' ] && PHP_extension=ZendGuardLoader
-            [ "${Loader}" = '2' ] && PHP_extension=0ioncube
+            [ "${Loader}" = '2' ] && PHP_extension=ioncube
             break
           fi
         done
         if [ "${ACTION}" = '1' ]; then
           Check_PHP_Extension
           if [ "${Loader}" = '1' ]; then
-            if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]] || [ "${armplatform}" != 'y' ]; then
-              if [ -e ${php_install_dir}/etc/php.d/ext-opcache.ini ]; then
-                echo; echo "${CWARNING}You have to install OpCache, You need to uninstall it before install ZendGuardLoader! ${CEND}"; echo; exit 1
-              else
-                zendguardloader_yn='y' && checkDownload
-                Install_ZendGuardLoader
-                Check_succ
-              fi
+            if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]] && [ "${armplatform}" != 'y' ]; then
+              zendguardloader_yn='y' && checkDownload
+              Install_ZendGuardLoader
+              Check_succ
             else
               echo; echo "${CWARNING}Your php ${PHP_detail_ver} or platform ${TARGET_ARCH} does not support ${PHP_extension}! ${CEND}";
             fi
@@ -378,7 +370,7 @@ What Are You Doing?
           make -j ${THREAD} && make install
           popd;popd
           rm -rf php-${PHP_detail_ver}
-          echo "extension=fileinfo.so" > ${php_install_dir}/etc/php.d/ext-fileinfo.ini
+          echo "extension=fileinfo.so" > ${php_install_dir}/etc/php.d/04-fileinfo.ini
           Check_succ
         else
           Uninstall_succ
@@ -473,7 +465,7 @@ What Are You Doing?
           popd
           rm -rf swoole-${swoole_ver} 
           popd
-          echo 'extension=swoole.so' > ${php_install_dir}/etc/php.d/ext-swoole.ini
+          echo 'extension=swoole.so' > ${php_install_dir}/etc/php.d/06-swoole.ini
           Check_succ
         else
           Uninstall_succ
@@ -514,7 +506,7 @@ What Are You Doing?
           chown -R ${run_user}.${run_user} ${wwwroot_dir}/default/webgrind
           sed -i 's@static $storageDir.*@static $storageDir = "/tmp/webgrind";@' ${wwwroot_dir}/default/webgrind/config.php
           sed -i 's@static $profilerDir.*@static $profilerDir = "/tmp/xdebug";@' ${wwwroot_dir}/default/webgrind/config.php
-          cat > ${php_install_dir}/etc/php.d/ext-xdebug.ini << EOF
+          cat > ${php_install_dir}/etc/php.d/08-xdebug.ini << EOF
 [xdebug]
 zend_extension=xdebug.so
 xdebug.trace_output_dir=/tmp/xdebug

+ 1 - 1
include/GraphicsMagick.sh

@@ -36,7 +36,7 @@ Install_php-gmagick() {
     make -j ${THREAD} && make install
     popd
     if [ -f "${phpExtensionDir}/gmagick.so" ]; then
-      echo 'extension=gmagick.so' > ${php_install_dir}/etc/php.d/ext-gmagick.ini
+      echo 'extension=gmagick.so' > ${php_install_dir}/etc/php.d/03-gmagick.ini
       echo "${CSUCCESS}PHP gmagick module installed successfully! ${CEND}"
       rm -rf gmagick-${gmagick_for_php7_ver} gmagick-${gmagick_ver}
     else

+ 1 - 1
include/ImageMagick.sh

@@ -31,7 +31,7 @@ Install_php-imagick() {
     make -j ${THREAD} && make install
     popd
     if [ -f "${phpExtensionDir}/imagick.so" ]; then
-      echo 'extension=imagick.so' > ${php_install_dir}/etc/php.d/ext-imagick.ini
+      echo 'extension=imagick.so' > ${php_install_dir}/etc/php.d/03-imagick.ini
       echo "${CSUCCESS}PHP imagick module installed successfully! ${CEND}"
       rm -rf imagick-${imagick_ver}
     else

+ 32 - 54
include/ZendGuardLoader.sh

@@ -14,67 +14,45 @@ Install_ZendGuardLoader() {
   PHP_main_ver=${PHP_detail_ver%.*}
   phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
   [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
-  if [ "${OS_BIT}" == '64' ]; then
-    if [ "$PHP_main_ver" == '5.6' ]; then
-      tar xzf zend-loader-php5.6-linux-x86_64.tar.gz
-      /bin/cp zend-loader-php5.6-linux-x86_64/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf zend-loader-php5.6-linux-x86_64
-    fi
-
-    if [ "$PHP_main_ver" == '5.5' ]; then
-      tar xzf zend-loader-php5.5-linux-x86_64.tar.gz
-      /bin/cp zend-loader-php5.5-linux-x86_64/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf zend-loader-php5.5-linux-x86_64
-    fi
-
-    if [ "$PHP_main_ver" == '5.4' ]; then
-      tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
-      /bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
-    fi
-
-    if [ "$PHP_main_ver" == '5.3' ]; then
-      tar xzf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
-      /bin/cp ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf ZendGuardLoader-php-5.3-linux-glibc23-x86_64
-    fi
-  else
-    if [ "$PHP_main_ver" == '5.6' ]; then
-      tar xzf zend-loader-php5.6-linux-i386.tar.gz
-      /bin/cp zend-loader-php5.6-linux-i386/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf zend-loader-php5.6-linux-i386
-    fi
-
-    if [ "$PHP_main_ver" == '5.5' ]; then
-      tar xzf zend-loader-php5.5-linux-i386.tar.gz
-      /bin/cp zend-loader-php5.5-linux-i386/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf zend-loader-php5.5-linux-x386
-    fi
-
-    if [ "$PHP_main_ver" == '5.4' ]; then
-      tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz
-      /bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386/php-5.4.x/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386
-    fi
-
-    if [ "$PHP_main_ver" == '5.3' ]; then
-      tar xzf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
-      /bin/cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so ${phpExtensionDir}
-      rm -rf ZendGuardLoader-php-5.3-linux-glibc23-i386
-    fi
-  fi
-
-  if [ -f "${phpExtensionDir}/ZendGuardLoader.so" ]; then
-    cat > ${php_install_dir}/etc/php.d/ext-ZendGuardLoader.ini << EOF
+  if [ -n "`echo $phpExtensionDir | grep 'non-zts'`" ]; then
+    case "${PHP_main_ver}" in
+      5.6)
+        tar xzf zend-loader-php5.6-linux-${SYS_BIT_c}.tar.gz
+        /bin/cp zend-loader-php5.6-linux-${SYS_BIT_c}/ZendGuardLoader.so ${phpExtensionDir}
+        rm -rf zend-loader-php5.6-linux-${SYS_BIT_c}
+        ;;
+      5.5)
+        tar xzf zend-loader-php5.5-linux-${SYS_BIT_c}.tar.gz
+        /bin/cp zend-loader-php5.5-linux-${SYS_BIT_c}/ZendGuardLoader.so ${phpExtensionDir}
+        rm -rf zend-loader-php5.5-linux-${SYS_BIT_c}
+        ;;
+      5.4)
+        tar xzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-${SYS_BIT_c}.tar.gz
+        /bin/cp ZendGuardLoader-70429-PHP-5.4-linux-glibc23-${SYS_BIT_c}/php-5.4.x/ZendGuardLoader.so ${phpExtensionDir}
+        rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-${SYS_BIT_c}
+        ;;
+      5.3)
+        tar xzf ZendGuardLoader-php-5.3-linux-glibc23-${SYS_BIT_c}.tar.gz
+        /bin/cp ZendGuardLoader-php-5.3-linux-glibc23-${SYS_BIT_c}/php-5.3.x/ZendGuardLoader.so ${phpExtensionDir}
+        rm -rf ZendGuardLoader-php-5.3-linux-glibc23-${SYS_BIT_c}
+        ;;
+      *)
+        echo "Error! Your PHP ${PHP_detail_ver} does not support ZendGuardLoader!"
+        ;;
+    esac
+  
+    if [ -f "${phpExtensionDir}/ZendGuardLoader.so" ]; then
+      cat > ${php_install_dir}/etc/php.d/01-ZendGuardLoader.ini<< EOF
 [Zend Guard Loader]
 zend_extension=${phpExtensionDir}/ZendGuardLoader.so
 zend_loader.enable=1
 zend_loader.disable_licensing=0
 zend_loader.obfuscation_level_support=3
 EOF
-    echo "${CSUCCESS}PHP ZendGuardLoader module installed successfully! ${CEND}"
+      echo "${CSUCCESS}PHP ZendGuardLoader module installed successfully! ${CEND}"
+    fi
   else
-    echo "${CFAILURE}PHP ZendGuardLoader module install failed, Please contact the author! ${CEND}"
+    echo "Error! Your Apache's prefork or PHP already enable thread safety! " 
   fi
   popd
 }

+ 1 - 1
include/alisql-5.6.sh

@@ -16,7 +16,7 @@ Install_AliSQL56() {
   [ ! -d "${alisql_install_dir}" ] && mkdir -p ${alisql_install_dir}
   mkdir -p ${alisql_data_dir};chown mysql.mysql -R ${alisql_data_dir}
 
-  tar xvf alisql-${alisql_ver}.tar.gz
+  tar xzf alisql-${alisql_ver}.tar.gz
   pushd alisql-${alisql_ver}
   cmake . -DCMAKE_INSTALL_PREFIX=${alisql_install_dir} \
   -DCMAKE_BUILD_TYPE="Release" \

+ 2 - 1
include/apache-2.4.sh

@@ -36,7 +36,8 @@ Install_Apache24() {
   [ ! -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 LD_LIBRARY_PATH=${openssl_install_dir}/lib ./configure --prefix=${apache_install_dir} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
+  [[ "${php_option}" =~ ^[1-4]$ ]] && Apache_mpm_arg='--with-mpm=prefork'
+  LDFLAGS=-ldl LD_LIBRARY_PATH=${openssl_install_dir}/lib ./configure --prefix=${apache_install_dir} ${Apache_mpm_arg} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
   make -j ${THREAD} && make install
   unset LDFLAGS
   if [ -e "${apache_install_dir}/conf/httpd.conf" ]; then

+ 1 - 1
include/apcu.sh

@@ -23,7 +23,7 @@ Install_APCU() {
   ./configure --with-php-config=${php_install_dir}/bin/php-config
   make -j ${THREAD} && make install
   if [ -f "${phpExtensionDir}/apcu.so" ]; then
-    cat > ${php_install_dir}/etc/php.d/ext-apcu.ini << EOF
+    cat > ${php_install_dir}/etc/php.d/02-apcu.ini << EOF
 [apcu]
 extension=apcu.so
 apc.enabled=1

+ 1 - 1
include/boost.sh

@@ -11,7 +11,7 @@ installBoost() {
   pushd ${oneinstack_dir}/src > /dev/null
   if [ ! -e "/usr/local/lib/libboost_system.so" ]; then
     boostVersion2=$(echo ${boost_ver} | awk -F. '{print $1}')_$(echo ${boost_ver} | awk -F. '{print $2}')_$(echo ${boost_ver} | awk -F. '{print $3}')
-    tar xvf boost_${boostVersion2}.tar.gz
+    tar xzf boost_${boostVersion2}.tar.gz
     pushd boost_${boostVersion2}
     ./bootstrap.sh
     ./bjam --prefix=/usr/local

+ 11 - 43
include/check_download.sh

@@ -649,48 +649,20 @@ checkDownload() {
   if [ "${zendguardloader_yn}" == 'y' -a "${armplatform}" != 'y' ]; then
     case "${php_option}" in
       4)
-        if [ "${OS_BIT}" == "64" ]; then
-          # 64 bit
-          echo "Download zend loader for php 5.6..."
-          src_url=${mirrorLink}/zend-loader-php5.6-linux-x86_64.tar.gz && Download_src
-        else
-          # 32 bit
-          echo "Download zend loader for php 5.6..."
-          src_url=${mirrorLink}/zend-loader-php5.6-linux-i386.tar.gz && Download_src
-        fi
+        echo "Download zend loader for php 5.6..."
+        src_url=${mirrorLink}/zend-loader-php5.6-linux-${SYS_BIT_c}.tar.gz && Download_src
         ;;
       3)
-        if [ "${OS_BIT}" == "64" ]; then
-          # 64 bit
-          echo "Download zend loader for php 5.5..."
-          src_url=${mirrorLink}/zend-loader-php5.5-linux-x86_64.tar.gz && Download_src
-        else
-          # 32 bit
-          echo "Download zend loader for php 5.5..."
-          src_url=${mirrorLink}/zend-loader-php5.5-linux-i386.tar.gz && Download_src
-        fi
+        echo "Download zend loader for php 5.5..."
+        src_url=${mirrorLink}/zend-loader-php5.5-linux-${SYS_BIT_c}.tar.gz && Download_src
         ;;
       2)
-        if [ "${OS_BIT}" == "64" ]; then
-          # 64 bit
-          echo "Download zend loader for php 5.4..."
-          src_url=${mirrorLink}/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz && Download_src
-        else
-          # 32 bit
-          echo "Download zend loader for php 5.4..."
-          src_url=${mirrorLink}/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz && Download_src
-        fi
+        echo "Download zend loader for php 5.4..."
+        src_url=${mirrorLink}/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-${SYS_BIT_c}.tar.gz && Download_src
         ;;
       1)
-        if [ "${OS_BIT}" == "64" ]; then
-          # 64 bit
-          echo "Download zend loader for php 5.3..."
-          src_url=${mirrorLink}/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz && Download_src
-        else
-          # 32 bit
-          echo "Download zend loader for php 5.3..."
-          src_url=${mirrorLink}/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz && Download_src
-        fi
+        echo "Download zend loader for php 5.3..."
+        src_url=${mirrorLink}/ZendGuardLoader-php-5.3-linux-glibc23-${SYS_BIT_c}.tar.gz && Download_src
         ;;
     esac
   fi
@@ -707,14 +679,10 @@ checkDownload() {
 
   if [ "${ioncube_yn}" == 'y' ]; then
     echo "Download ioncube..."
-    if [ "${OS_BIT}" == '64' ]; then
-        src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && Download_src
+    if [ "${TARGET_ARCH}" == "armv7" ]; then
+      src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz && Download_src
     else
-      if [ "${TARGET_ARCH}" == "armv7" ]; then
-        src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz && Download_src
-      else
-        src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz && Download_src
-      fi
+      src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_${SYS_BIT_a}.tar.gz && Download_src
     fi
   fi
 

+ 6 - 2
include/check_os.sh

@@ -55,11 +55,15 @@ fi
 if [ "$(getconf WORD_BIT)" == "32" ] && [ "$(getconf LONG_BIT)" == "64" ]; then
   OS_BIT=64
   SYS_BIG_FLAG=x64 #jdk
-  SYS_BIT_a=x86_64;SYS_BIT_b=x86_64; #mariadb
+  SYS_BIT_a=x86_64 #mariadb
+  SYS_BIT_b=x86_64 #mariadb
+  SYS_BIT_c=x86_64 #ZendGuardLoader
 else
   OS_BIT=32
   SYS_BIG_FLAG=i586
-  SYS_BIT_a=x86;SYS_BIT_b=i686;
+  SYS_BIT_a=x86
+  SYS_BIT_b=i686
+  SYS_BIT_c=i386
 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"}')

+ 1 - 1
include/eaccelerator.sh

@@ -33,7 +33,7 @@ Install_eAccelerator() {
   popd
   if [ -f "${phpExtensionDir}/eaccelerator.so" ]; then
     mkdir /var/eaccelerator_cache;chown -R ${run_user}.${run_user} /var/eaccelerator_cache
-    cat > ${php_install_dir}/etc/php.d/ext-eaccelerator.ini << EOF
+    cat > ${php_install_dir}/etc/php.d/02-eaccelerator.ini << EOF
 [eaccelerator]
 zend_extension=${phpExtensionDir}/eaccelerator.so
 eaccelerator.shm_size=64

+ 4 - 8
include/ioncube.sh

@@ -13,14 +13,10 @@ Install_ionCube() {
   PHP_detail_ver=`${php_install_dir}/bin/php -r 'echo PHP_VERSION;'`
   PHP_main_ver=${PHP_detail_ver%.*}
   phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-  if [ "${OS_BIT}" == '64' ]; then
-      tar xzf ioncube_loaders_lin_x86-64.tar.gz
+  if  [ "${TARGET_ARCH}" == "armv7" ]; then
+    tar xzf ioncube_loaders_lin_armv7l.tar.gz
   else
-    if  [ "${TARGET_ARCH}" == "armv7" ]; then
-      tar xzf ioncube_loaders_lin_armv7l.tar.gz
-    else
-      tar xzf ioncube_loaders_lin_x86.tar.gz
-    fi
+    tar xzf ioncube_loaders_lin_${SYS_BIT_a}.tar.gz
   fi
 
   [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
@@ -94,7 +90,7 @@ Install_ionCube() {
       ;;
   esac
 
-  echo "zend_extension=${zend_extension}" > ${php_install_dir}/etc/php.d/ext-0ioncube.ini
+  echo "zend_extension=${zend_extension}" > ${php_install_dir}/etc/php.d/00-ioncube.ini
   rm -rf ioncube
   popd
 }

+ 1 - 1
include/mariadb-10.0.sh

@@ -22,7 +22,7 @@ Install_MariaDB100() {
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mariadb_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mariadb_install_dir}@g" ${mariadb_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mariadb-${mariadb100_ver}.tar.gz
+    tar xzf mariadb-${mariadb100_ver}.tar.gz
     pushd mariadb-${mariadb100_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${mariadb_install_dir} \
     -DMYSQL_DATADIR=${mariadb_data_dir} \

+ 1 - 1
include/mariadb-10.1.sh

@@ -22,7 +22,7 @@ Install_MariaDB101() {
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mariadb_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mariadb_install_dir}@g" ${mariadb_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mariadb-${mariadb101_ver}.tar.gz
+    tar xzf mariadb-${mariadb101_ver}.tar.gz
     pushd mariadb-${mariadb101_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${mariadb_install_dir} \
     -DMYSQL_DATADIR=${mariadb_data_dir} \

+ 1 - 1
include/mariadb-10.2.sh

@@ -22,7 +22,7 @@ Install_MariaDB102() {
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mariadb_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mariadb_install_dir}@g" ${mariadb_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mariadb-${mariadb102_ver}.tar.gz
+    tar xzf mariadb-${mariadb102_ver}.tar.gz
     pushd mariadb-${mariadb102_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${mariadb_install_dir} \
     -DMYSQL_DATADIR=${mariadb_data_dir} \

+ 1 - 1
include/mariadb-5.5.sh

@@ -22,7 +22,7 @@ Install_MariaDB55() {
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mariadb_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mariadb_install_dir}@g" ${mariadb_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mariadb-${mariadb55_ver}.tar.gz
+    tar xzf mariadb-${mariadb55_ver}.tar.gz
     pushd mariadb-${mariadb55_ver}
     [ "${armplatform}" == "y" ] && patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
     cmake . -DCMAKE_INSTALL_PREFIX=${mariadb_install_dir} \

+ 3 - 2
include/memcached.sh

@@ -31,6 +31,7 @@ Install_memcached() {
     let memcachedCache="${Mem}/8"
     [ -n "$(grep 'CACHESIZE=' /etc/init.d/memcached)" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=${memcachedCache}@" /etc/init.d/memcached
     [ -n "$(grep 'start_instance default 256;' /etc/init.d/memcached)" ] && sed -i "s@start_instance default 256;@start_instance default ${memcachedCache};@" /etc/init.d/memcached
+    [ -e /usr/bin/systemctl ] && systemctl daemon-reload
     service memcached start
     rm -rf memcached-${memcached_ver}
   else
@@ -60,7 +61,7 @@ Install_php-memcache() {
     make -j ${THREAD} && make install
     popd
     if [ -f "${phpExtensionDir}/memcache.so" ]; then
-      echo "extension=memcache.so" > ${php_install_dir}/etc/php.d/ext-memcache.ini
+      echo "extension=memcache.so" > ${php_install_dir}/etc/php.d/05-memcache.ini
       echo "${CSUCCESS}PHP memcache module installed successfully! ${CEND}"
       rm -rf pecl-memcache-php7 memcache-${memcache_pecl_ver}
     else
@@ -96,7 +97,7 @@ Install_php-memcached() {
     make -j ${THREAD} && make install
     popd
     if [ -f "${phpExtensionDir}/memcached.so" ]; then
-      cat > ${php_install_dir}/etc/php.d/ext-memcached.ini << EOF
+      cat > ${php_install_dir}/etc/php.d/05-memcached.ini << EOF
 extension=memcached.so
 memcached.use_sasl=1
 EOF

+ 2 - 2
include/mysql-5.5.sh

@@ -17,12 +17,12 @@ Install_MySQL55() {
   mkdir -p ${mysql_data_dir};chown mysql.mysql -R ${mysql_data_dir}
 
   if [ "${dbinstallmethod}" == "1" ]; then
-    tar xvf mysql-${mysql55_ver}-linux-glibc2.12-${SYS_BIT_b}.tar.gz
+    tar xzf mysql-${mysql55_ver}-linux-glibc2.12-${SYS_BIT_b}.tar.gz
     mv mysql-${mysql55_ver}-linux-glibc2.12-${SYS_BIT_b}/* ${mysql_install_dir}
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mysql_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mysql_install_dir}@g" ${mysql_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mysql-${mysql55_ver}.tar.gz
+    tar xzf mysql-${mysql55_ver}.tar.gz
     pushd mysql-${mysql55_ver}
     [ "${armplatform}" == "y" ] && patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
     cmake . -DCMAKE_INSTALL_PREFIX=${mysql_install_dir} \

+ 2 - 2
include/mysql-5.6.sh

@@ -17,12 +17,12 @@ Install_MySQL56() {
   mkdir -p ${mysql_data_dir};chown mysql.mysql -R ${mysql_data_dir}
 
   if [ "${dbinstallmethod}" == "1" ]; then
-    tar xvf mysql-${mysql56_ver}-linux-glibc2.12-${SYS_BIT_b}.tar.gz
+    tar xzf mysql-${mysql56_ver}-linux-glibc2.12-${SYS_BIT_b}.tar.gz
     mv mysql-${mysql56_ver}-linux-glibc2.12-${SYS_BIT_b}/* ${mysql_install_dir}
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mysql_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mysql_install_dir}@g" ${mysql_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mysql-${mysql56_ver}.tar.gz
+    tar xzf mysql-${mysql56_ver}.tar.gz
     pushd mysql-${mysql56_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${mysql_install_dir} \
     -DMYSQL_DATADIR=${mysql_data_dir} \

+ 2 - 2
include/mysql-5.7.sh

@@ -17,12 +17,12 @@ Install_MySQL57() {
   mkdir -p ${mysql_data_dir};chown mysql.mysql -R ${mysql_data_dir}
 
   if [ "${dbinstallmethod}" == "1" ]; then
-    tar xvf mysql-${mysql57_ver}-linux-glibc2.12-${SYS_BIT_b}.tar.gz
+    tar xzf mysql-${mysql57_ver}-linux-glibc2.12-${SYS_BIT_b}.tar.gz
     mv mysql-${mysql57_ver}-linux-glibc2.12-${SYS_BIT_b}/* ${mysql_install_dir}
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${mysql_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/mysql@${mysql_install_dir}@g" ${mysql_install_dir}/bin/mysqld_safe
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf mysql-${mysql57_ver}.tar.gz
+    tar xzf mysql-${mysql57_ver}.tar.gz
     pushd mysql-${mysql57_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${mysql_install_dir} \
     -DMYSQL_DATADIR=${mysql_data_dir} \

+ 2 - 2
include/pecl_mongodb.sh

@@ -20,7 +20,7 @@ Install_pecl-mongodb() {
       make -j ${THREAD} && make install
       popd
       if [ -f "${phpExtensionDir}/mongo.so" ]; then
-        echo 'extension=mongo.so' > ${php_install_dir}/etc/php.d/ext-mongo.ini
+        echo 'extension=mongo.so' > ${php_install_dir}/etc/php.d/07-mongo.ini
         rm -rf mongo-${mongo_pecl_ver}
         echo "${CSUCCESS}PHP mongo module installed successfully! ${CEND}"
       else
@@ -34,7 +34,7 @@ Install_pecl-mongodb() {
       make -j ${THREAD} && make install
       popd
       if [ -f "${phpExtensionDir}/mongodb.so" ]; then
-        echo 'extension=mongodb.so' > ${php_install_dir}/etc/php.d/ext-mongodb.ini
+        echo 'extension=mongodb.so' > ${php_install_dir}/etc/php.d/07-mongodb.ini
         rm -rf mongodb-${mongodb_pecl_ver}
         echo "${CSUCCESS}PHP mongodb module installed successfully! ${CEND}"
       else

+ 2 - 2
include/pecl_pgsql.sh

@@ -24,8 +24,8 @@ Install_pecl-pgsql() {
   make -j ${THREAD} && make install
   popd
   if [ -f "${phpExtensionDir}/pgsql.so" -a -f "${phpExtensionDir}/pdo_pgsql.so" ]; then
-    echo 'extension=pgsql.so' > ${php_install_dir}/etc/php.d/ext-pgsql.ini
-    echo 'extension=pdo_pgsql.so' >> ${php_install_dir}/etc/php.d/ext-pgsql.ini
+    echo 'extension=pgsql.so' > ${php_install_dir}/etc/php.d/07-pgsql.ini
+    echo 'extension=pdo_pgsql.so' >> ${php_install_dir}/etc/php.d/07-pgsql.ini
     echo "${CSUCCESS}PHP pgsql module installed successfully! ${CEND}"
     popd
     rm -rf php-${PHP_detail_ver} 

+ 2 - 2
include/percona-5.5.sh

@@ -18,12 +18,12 @@ Install_Percona55() {
 
   if [ "${dbinstallmethod}" == "1" ]; then
     perconaVerStr1=$(echo ${percona55_ver} | sed "s@-@-rel@")
-    tar xvf Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}.tar.gz
+    tar xzf Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}.tar.gz
     mv Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}/* ${percona_install_dir}
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${percona_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}@${percona_install_dir}@g" ${percona_install_dir}/bin/mysqld_safe 
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf percona-server-${percona55_ver}.tar.gz
+    tar xzf percona-server-${percona55_ver}.tar.gz
     pushd percona-server-${percona55_ver}
     [ "${armplatform}" == "y" ] && patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
     cmake . -DCMAKE_INSTALL_PREFIX=${percona_install_dir} \

+ 2 - 2
include/percona-5.6.sh

@@ -18,12 +18,12 @@ Install_Percona56() {
 
   if [ "${dbinstallmethod}" == "1" ]; then
     perconaVerStr1=$(echo ${percona56_ver} | sed "s@-@-rel@")
-    tar xvf Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}.tar.gz
+    tar xzf Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}.tar.gz
     mv Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}/* ${percona_install_dir}
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${percona_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/Percona-Server-${perconaVerStr1}-Linux.${SYS_BIT_b}.${sslLibVer}@${percona_install_dir}@g" ${percona_install_dir}/bin/mysqld_safe 
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf percona-server-${percona56_ver}.tar.gz
+    tar xzf percona-server-${percona56_ver}.tar.gz
     pushd percona-server-${percona56_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${percona_install_dir} \
     -DMYSQL_DATADIR=${percona_data_dir} \

+ 2 - 2
include/percona-5.7.sh

@@ -17,12 +17,12 @@ Install_Percona57() {
   mkdir -p ${percona_data_dir};chown mysql.mysql -R ${percona_data_dir}
 
   if [ "${dbinstallmethod}" == "1" ]; then
-    tar xvf Percona-Server-${percona57_ver}-Linux.${SYS_BIT_b}.${sslLibVer}.tar.gz
+    tar xzf Percona-Server-${percona57_ver}-Linux.${SYS_BIT_b}.${sslLibVer}.tar.gz
     mv Percona-Server-${percona57_ver}-Linux.${SYS_BIT_b}.${sslLibVer}/* ${percona_install_dir}
     sed -i 's@executing mysqld_safe@executing mysqld_safe\nexport LD_PRELOAD=/usr/local/lib/libjemalloc.so@' ${percona_install_dir}/bin/mysqld_safe
     sed -i "s@/usr/local/Percona-Server-${percona57_ver}-Linux.${SYS_BIT_b}.${sslLibVer}@${percona_install_dir}@g" ${percona_install_dir}/bin/mysqld_safe 
   elif [ "${dbinstallmethod}" == "2" ]; then
-    tar xvf percona-server-${percona57_ver}.tar.gz
+    tar xzf percona-server-${percona57_ver}.tar.gz
     pushd percona-server-${percona57_ver}
     cmake . -DCMAKE_INSTALL_PREFIX=${percona_install_dir} \
     -DMYSQL_DATADIR=${percona_data_dir} \

+ 1 - 1
include/php-5.5.sh

@@ -119,7 +119,7 @@ Install_PHP55() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
   
-  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so
 opcache.enable=1

+ 1 - 1
include/php-5.6.sh

@@ -120,7 +120,7 @@ Install_PHP56() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
   
-  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so
 opcache.enable=1

+ 1 - 1
include/php-7.0.sh

@@ -122,7 +122,7 @@ Install_PHP70() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
   
-  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so
 opcache.enable=1

+ 1 - 1
include/php-7.1.sh

@@ -122,7 +122,7 @@ Install_PHP71() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
   
-  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so
 opcache.enable=1

+ 1 - 1
include/php-7.2.sh

@@ -103,7 +103,7 @@ Install_PHP72() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
   
-  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so
 opcache.enable=1

+ 1 - 1
include/redis.sh

@@ -65,7 +65,7 @@ Install_php-redis() {
     ./configure --with-php-config=${php_install_dir}/bin/php-config
     make -j ${THREAD} && make install
     if [ -f "${phpExtensionDir}/redis.so" ]; then
-      echo 'extension=redis.so' > ${php_install_dir}/etc/php.d/ext-redis.ini
+      echo 'extension=redis.so' > ${php_install_dir}/etc/php.d/05-redis.ini
       echo "${CSUCCESS}PHP Redis module installed successfully! ${CEND}"
       popd
       rm -rf redis-$redis_pecl_ver

+ 1 - 2
include/upgrade_oneinstack.sh

@@ -14,7 +14,6 @@ Upgrade_OneinStack() {
   [ ! -e install.sh ] && install_flag=n 
   if [ "$oneinstack_md5" != "$Latest_OneinStack_MD5" ]; then
     /bin/mv options.conf /tmp
-    /bin/mv backup*.sh /tmp
     sed -i '/oneinstack_dir=/d' /tmp/options.conf
     [ -e /tmp/oneinstack.tar.gz ] && rm -rf /tmp/oneinstack.tar.gz
     wget -c http://mirrors.linuxeye.com/oneinstack.tar.gz -O /tmp/oneinstack.tar.gz > /dev/null 2>&1 
@@ -28,7 +27,7 @@ Upgrade_OneinStack() {
       sed -i "s@^${Key}=.*@${Key}=${Value}@" ./options.conf
     done
     rm -rf /tmp/{oneinstack.tar.gz,options.conf}
-    [ "$install_flag" == 'n' ] && { /bin/mv /tmp/backup*.sh .; rm -rf install.sh LICENSE README.md; }
+    [ "$install_flag" == 'n' ] && rm -rf install.sh LICENSE README.md
     sed -i "s@^oneinstack_md5=.*@oneinstack_md5=${Latest_OneinStack_MD5}@" ./options.conf
     echo
     echo "${CSUCCESS}Congratulations! OneinStack upgrade successful! ${CEND}"

+ 3 - 1
include/upgrade_web.sh

@@ -224,7 +224,9 @@ Upgrade_Apache() {
     if [ "$Apache_flag" == '24' ]; then
       /bin/cp -R ../apr-${apr_ver} ./srclib/apr
       /bin/cp -R ../apr-util-${apr_util_ver} ./srclib/apr-util
-      LDFLAGS=-ldl LD_LIBRARY_PATH=${openssl_install_dir}/lib ./configure --prefix=${apache_install_dir} --with-mpm=prefork --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
+      [ -e "${php_install_dir}/bin/phpize" ] && { PHP_detail_ver=`${php_install_dir}/bin/php -r 'echo PHP_VERSION;'`; PHP_master_ver=${PHP_detail_ver%%.*}; }
+      [ "${PHP_master_ver}" == '5' ] && Apache_mpm_arg='--with-mpm=prefork'
+      LDFLAGS=-ldl LD_LIBRARY_PATH=${openssl_install_dir}/lib ./configure --prefix=${apache_install_dir} ${Apache_mpm_arg} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
     elif [ "$Apache_flag" == '22' ]; then
       [ "${Ubuntu_ver}" == "12" ] && sed -i '@SSL_PROTOCOL_SSLV2@d' modules/ssl/ssl_engine_io.c
       LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --with-mpm=prefork --with-included-apr --enable-headers --enable-deflate --enable-so --enable-rewrite --enable-ssl--with-ssl=${openssl_install_dir} --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all

+ 1 - 1
include/xcache.sh

@@ -23,7 +23,7 @@ Install_XCache() {
     touch /tmp/xcache;chown ${run_user}.${run_user} /tmp/xcache
     let xcacheCount="${CPU}+1"
     let xcacheSize="${Memory_limit}/2"
-    cat > ${php_install_dir}/etc/php.d/ext-xcache.ini << EOF
+    cat > ${php_install_dir}/etc/php.d/04-xcache.ini << EOF
 [xcache-common]
 extension=xcache.so
 [xcache.admin]

+ 4 - 4
include/zendopcache.sh

@@ -14,10 +14,10 @@ Install_ZendOPcache() {
   PHP_detail_ver=$(${php_install_dir}/bin/php -r 'echo PHP_VERSION;')
   PHP_main_ver=${PHP_detail_ver%.*}
   if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
-    tar xvf zendopcache-${zendopcache_ver}.tgz
+    tar xzf zendopcache-${zendopcache_ver}.tgz
     pushd zendopcache-${zendopcache_ver}
   else
-    tar xvf php-${PHP_detail_ver}.tar.gz
+    tar xzf php-${PHP_detail_ver}.tar.gz
     pushd php-${PHP_detail_ver}/ext/opcache
   fi
 
@@ -29,7 +29,7 @@ Install_ZendOPcache() {
     # write opcache configs
     if [[ "${PHP_main_ver}" =~ ^5.[3-4]$ ]]; then
       # For php 5.3 5.4
-      cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+      cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=${phpExtensionDir}/opcache.so
 opcache.enable=1
@@ -44,7 +44,7 @@ opcache.enable_cli=1
 EOF
     else
       # For php 5.5+
-      cat > ${php_install_dir}/etc/php.d/ext-opcache.ini << EOF
+      cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
 [opcache]
 zend_extension=opcache.so
 opcache.enable=1

+ 16 - 12
uninstall.sh

@@ -90,7 +90,7 @@ Uninstall_Web() {
   sed -i 's@^website_name=.*@website_name=@' ./options.conf
   sed -i 's@^local_bankup_yn=.*@local_bankup_yn=y@' ./options.conf
   sed -i 's@^remote_bankup_yn=.*@remote_bankup_yn=n@' ./options.conf
-  echo "${CMSG}Web uninstall completed${CEND}"
+  echo "${CMSG}Web uninstall completed! ${CEND}"
 }
 
 Print_MySQL() {
@@ -119,6 +119,7 @@ Uninstall_MySQL() {
     [ -e "${db_data_dir}" ] && /bin/mv ${db_data_dir}{,$(date +%Y%m%d%H)}
     sed -i 's@^dbrootpwd=.*@dbrootpwd=@' ./options.conf
     sed -i "s@${db_install_dir}/bin:@@" /etc/profile
+    echo "${CMSG}MySQL uninstall completed! ${CEND}"
   else
     echo "${CWARNING}MySQL already uninstalled! ${CEND}"
   fi
@@ -128,12 +129,13 @@ Uninstall_PostgreSQL() {
   # uninstall postgresql
   if [ -e "${pgsql_install_dir}/bin/psql" ]; then
     service postgresql stop > /dev/null 2>&1
-    rm -rf ${pgsql_install_dir} /etc/init.d/postgresql ${php_install_dir}/etc/php.d/ext-pgsql.ini
+    rm -rf ${pgsql_install_dir} /etc/init.d/postgresql
+    [ -e "${php_install_dir}/etc/php.d/07-pgsql.ini" ] && rm -rf ${php_install_dir}/etc/php.d/07-pgsql.ini 
     id -u postgres >/dev/null 2>&1 ; [ $? -eq 0 ] && userdel postgres 
     [ -e "${pgsql_data_dir}" ] && /bin/mv ${pgsql_data_dir}{,$(date +%Y%m%d%H)}
     sed -i 's@^dbpostgrespwd=.*@dbpostgrespwd=@' ./options.conf
     sed -i "s@${pgsql_install_dir}/bin:@@" /etc/profile
-    echo "${CMSG}PostgreSQL uninstall completed${CEND}"
+    echo "${CMSG}PostgreSQL uninstall completed! ${CEND}"
   else
     echo "${CWARNING}PostgreSQL already uninstalled! ${CEND}"
   fi
@@ -144,11 +146,13 @@ Uninstall_MongoDB() {
   if [ -e "${mongo_install_dir}/bin/mongo" ]; then
     service mongod stop > /dev/null 2>&1
     rm -rf ${mongo_install_dir} /etc/mongod.conf /etc/init.d/mongod /tmp/mongo*.sock
+    [ -e "${php_install_dir}/etc/php.d/07-mongo.ini" ] && rm -rf ${php_install_dir}/etc/php.d/07-mongo.ini 
+    [ -e "${php_install_dir}/etc/php.d/07-mongodb.ini" ] && rm -rf ${php_install_dir}/etc/php.d/07-mongodb.ini 
     id -u mongod > /dev/null 2>&1 ; [ $? -eq 0 ] && userdel mongod 
     [ -e "${mongo_data_dir}" ] && /bin/mv ${mongo_data_dir}{,$(date +%Y%m%d%H)}
     sed -i 's@^dbmongopwd=.*@dbmongopwd=@' ./options.conf
     sed -i "s@${mongo_install_dir}/bin:@@" /etc/profile
-    echo "${CMSG}MongoDB uninstall completed${CEND}"
+    echo "${CMSG}MongoDB uninstall completed! ${CEND}"
   else
     echo "${CWARNING}MongoDB already uninstalled! ${CEND}"
   fi
@@ -167,7 +171,7 @@ Uninstall_PHP() {
   [ -e "/usr/local/imagemagick" ] && rm -rf /usr/local/imagemagick
   [ -e "/usr/local/graphicsmagick" ] && rm -rf /usr/local/graphicsmagick
   sed -i "s@${php_install_dir}/bin:@@" /etc/profile
-  echo "${CMSG}PHP uninstall completed${CEND}"
+  echo "${CMSG}PHP uninstall completed! ${CEND}"
 }
 
 Print_HHVM() {
@@ -181,7 +185,7 @@ Print_HHVM() {
 Uninstall_HHVM() {
   [ -e "/etc/init.d/supervisord" ] && { service supervisord stop > /dev/null 2>&1; rm -rf /etc/supervisord.conf /etc/init.d/supervisord; }
   [ -e "/usr/bin/hhvm" ] && { rpm -e hhvm; rm -rf /etc/hhvm /var/log/hhvm /usr/bin/hhvm; }
-  echo "${CMSG}HHVM uninstall completed${CEND}"
+  echo "${CMSG}HHVM uninstall completed! ${CEND}"
 }
 
 Print_PureFtpd() {
@@ -191,7 +195,7 @@ Print_PureFtpd() {
 
 Uninstall_PureFtpd() {
   [ -e "${pureftpd_install_dir}" ] && { service pureftpd stop > /dev/null 2>&1; rm -rf ${pureftpd_install_dir} /etc/init.d/pureftpd; }
-  echo "${CMSG}Pureftpd uninstall completed${CEND}"
+  echo "${CMSG}Pureftpd uninstall completed! ${CEND}"
 }
 
 Print_Redis() {
@@ -201,8 +205,8 @@ Print_Redis() {
 
 Uninstall_Redis() {
   [ -e "$redis_install_dir" ] && { service redis-server stop > /dev/null 2>&1; rm -rf $redis_install_dir /etc/init.d/redis-server /usr/local/bin/redis-*; }
-  [ -e "${php_install_dir}/etc/php.d/ext-redis.ini" ] && rm -rf ${php_install_dir}/etc/php.d/ext-redis.ini
-  echo "${CMSG}Redis uninstall completed${CEND}"
+  [ -e "${php_install_dir}/etc/php.d/05-redis.ini" ] && rm -rf ${php_install_dir}/etc/php.d/05-redis.ini 
+  echo "${CMSG}Redis uninstall completed! ${CEND}"
 }
 
 Print_Memcached() {
@@ -213,9 +217,9 @@ Print_Memcached() {
 
 Uninstall_Memcached() {
   [ -e "${memcached_install_dir}" ] && { service memcached stop > /dev/null 2>&1; rm -rf ${memcached_install_dir} /etc/init.d/memcached /usr/bin/memcached; }
-  [ -e "${php_install_dir}/etc/php.d/ext-memcache.ini" ] && rm -rf ${php_install_dir}/etc/php.d/ext-memcache.ini
-  [ -e "${php_install_dir}/etc/php.d/ext-memcached.ini" ] && rm -rf ${php_install_dir}/etc/php.d/ext-memcached.ini
-  echo "${CMSG}Memcached uninstall completed${CEND}"
+  [ -e "${php_install_dir}/etc/php.d/05-memcache.ini" ] && rm -rf ${php_install_dir}/etc/php.d/05-memcache.ini 
+  [ -e "${php_install_dir}/etc/php.d/05-memcached.ini" ] && rm -rf ${php_install_dir}/etc/php.d/05-memcached.ini 
+  echo "${CMSG}Memcached uninstall completed! ${CEND}"
 }
 
 Print_curlopenssl() {