Browse Source

Support apcu/ioncube for PHP 7.0

lj2007331 8 years ago
parent
commit
b38451896c

+ 54 - 25
addons.sh

@@ -26,6 +26,7 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 . ./include/color.sh
 . ./include/memory.sh
 . ./include/check_os.sh
+. ./include/check_download.sh
 . ./include/download.sh
 . ./include/get_char.sh
 
@@ -50,8 +51,15 @@ sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
 
 # Check PHP
 if [ -e "$php_install_dir/bin/phpize" ];then
-    PHP_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
-    PHP_main_version=${PHP_version%.*}
+    PHP_detail_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    PHP_main_version=${PHP_detail_version%.*}
+    PHP_yn=y
+    [ "$PHP_main_version" == '5.3' ] && PHP_version=1
+    [ "$PHP_main_version" == '5.4' ] && PHP_version=2
+    [ "$PHP_main_version" == '5.5' ] && PHP_version=3
+    [ "$PHP_main_version" == '5.6' ] && PHP_version=4
+    [ "$PHP_main_version" == '7.0' ] && PHP_version=5
 fi
 
 # Check PHP Extensions
@@ -66,7 +74,7 @@ Restart_PHP() {
 
 # Check succ
 Check_succ() {
-[ -f "`$php_install_dir/bin/php-config --extension-dir`/${PHP_extension}.so" ] && { Restart_PHP; echo;echo "${CSUCCESS}PHP $PHP_extension module installed successfully! ${CEND}"; }
+[ -f "${phpExtensionDir}/${PHP_extension}.so" ] && { Restart_PHP; echo;echo "${CSUCCESS}PHP $PHP_extension module installed successfully! ${CEND}"; }
 }
 
 # Uninstall succ
@@ -193,6 +201,7 @@ What Are You Doing?
                     if [ $PHP_cache = 1 ];then
                         cd $oneinstack_dir/src
                         if [[ $PHP_main_version =~ ^5.[3-4]$ ]];then
+                            src_url=https://pecl.php.net/get/zendopcache-${zendopcache_version}.tgz && Download_src
                             Install_ZendOPcache
                         elif [ "$PHP_main_version" == '5.5' ];then
                             src_url=http://www.php.net/distributions/php-$php_5_version.tar.gz && Download_src
@@ -212,28 +221,39 @@ What Are You Doing?
                         fi
                         Check_succ
                     elif [ $PHP_cache = 2 ];then
+                        cd $oneinstack_dir/src 
                         if [[ $PHP_main_version =~ ^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
+                            src_url=http://xcache.lighttpd.net/pub/Releases/${xcache_version}/xcache-${xcache_version}.tar.gz && Download_src
                             Install_XCache
                             Check_succ
                         else
                             echo "${CWARNING}Your php does not support XCache! ${CEND}"; exit 1
                         fi
-                    elif [ $PHP_cache = 3 ];then
-                        if [[ $PHP_main_version =~ ^5.[3-5]$ ]];then
+                    elif [ ${PHP_cache} = 3 ];then
+                        cd $oneinstack_dir/src 
+                        if [[ ${PHP_main_version} =~ ^5.[3-6]$ ]];then 
+                            src_url=http://pecl.php.net/get/apcu-${apcu_version}.tgz && Download_src
+                            Install_APCU
+                            Check_succ
+                        elif [[ ${PHP_main_version} =~ ^7.[0-1]$ ]];then
+                            src_url=http://pecl.php.net/get/apcu-${apcu_for_php7_version}.tgz && Download_src
                             Install_APCU
                             Check_succ
                         else
                             echo "${CWARNING}Your php does not support APCU! ${CEND}"; exit 1
                         fi
                     elif [ $PHP_cache = 4 ];then
+                        cd $oneinstack_dir/src 
                         if [ "$PHP_main_version" == '5.3' ];then
+                            src_url=https://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-${eaccelerator_version}.tar.bz2 && Download_src
                             Install_eAccelerator-0-9
                             Check_succ
                         elif [ "$PHP_main_version" == '5.4' ];then
+                            src_url=https://github.com/eaccelerator/eaccelerator/tarball/master && Download_src
                             Install_eAccelerator-1-0-dev
                             Check_succ
                         else
@@ -261,25 +281,31 @@ What Are You Doing?
                     break
                 fi
             done
-            if [ $ACTION = 1 ];then
-                Check_PHP_Extension
-                if [[ $PHP_main_version =~ ^5.[3-6]$ ]];then
-                    if [ $Loader = 1 ];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
-                            Install_ZendGuardLoader
-                            Check_succ
-                        fi
-                    elif [ $Loader = 2 ];then
-                        Install_ionCube
-                        Restart_PHP; echo "${CSUCCESS}PHP ioncube module installed successfully! ${CEND}";
-                    fi
+            if [ ${ACTION} = "1" ];then
+              Check_PHP_Extension
+              if [ ${Loader} = "1" ]; then
+                if [[ ${PHP_main_version} =~ ^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
                 else
-                    echo; echo "${CWARNING}Your php does not support $PHP_extension! ${CEND}";
+                  echo; echo "${CWARNING}Your php ${PHP_detail_version} or platform ${TARGET_ARCH} does not support ${PHP_extension}! ${CEND}";
                 fi
+              elif [ ${Loader} = "2" ]; then
+                if [[ ${PHP_main_version} =~ ^5.[3-6]$|^7.0$ ]] || [ "${TARGET_ARCH}" != "arm64" ]; then
+                  ionCube_yn=y && checkDownload
+                  Install_ionCube
+                  Restart_PHP; echo "${CSUCCESS}PHP ioncube module installed successfully! ${CEND}";
+                else
+                  echo; echo "${CWARNING}Your php ${PHP_detail_version} or platform ${TARGET_ARCH} does not support ${PHP_extension}! ${CEND}";
+                fi
+              fi
             else
-                Uninstall_succ
+              Uninstall_succ
             fi
             ;;
         3)
@@ -300,6 +326,7 @@ What Are You Doing?
             done
             if [ $ACTION = 1 ];then
                 Check_PHP_Extension
+                Magick_yn=y && checkDownload
                 if [ $Magick = 1 ];then
                     [ ! -d "/usr/local/imagemagick" ] && Install_ImageMagick
                     Install_php-imagick
@@ -321,9 +348,9 @@ What Are You Doing?
             if [ $ACTION = 1 ];then
                 Check_PHP_Extension
                 cd $oneinstack_dir/src
-                src_url=http://www.php.net/distributions/php-$PHP_version.tar.gz && Download_src
-                tar xzf php-$PHP_version.tar.gz
-                cd php-$PHP_version/ext/fileinfo
+                src_url=http://www.php.net/distributions/php-$PHP_detail_version.tar.gz && Download_src
+                tar xzf php-$PHP_detail_version.tar.gz
+                cd php-$PHP_detail_version/ext/fileinfo
                 $php_install_dir/bin/phpize
                 ./configure --with-php-config=$php_install_dir/bin/php-config
                 make -j ${THREAD} && make install
@@ -351,6 +378,7 @@ What Are You Doing?
                 fi
             done
             if [ $ACTION = 1 ];then
+                memcached_yn=y && checkDownload
                 if [ $Memcache = 1 ];then
                     [ ! -d "$memcached_install_dir/include/memcached" ] && Install_memcached
                     Check_PHP_Extension
@@ -367,7 +395,7 @@ What Are You Doing?
                     Install_php-memcache
                     PHP_extension=memcached && Check_PHP_Extension
                     Install_php-memcached
-                    [ -f "`$php_install_dir/bin/php-config --extension-dir`/memcache.so" -a "`$php_install_dir/bin/php-config --extension-dir`/memcached.so" ] && { Restart_PHP; echo;echo "${CSUCCESS}PHP memcache/memcached module installed successfully! ${CEND}"; }
+                    [ -f "${phpExtensionDir}/memcache.so" -a "${phpExtensionDir}/memcached.so" ] && { Restart_PHP; echo;echo "${CSUCCESS}PHP memcache/memcached module installed successfully! ${CEND}"; }
                 fi
             else
                 PHP_extension=memcache && Uninstall_succ
@@ -378,6 +406,7 @@ What Are You Doing?
         6)
             ACTION_FUN
             PHP_extension=redis
+            redis_yn=y && checkDownload
             if [ $ACTION = 1 ];then
                 [ ! -d "$redis_install_dir" ] && Install_redis-server
                 Check_PHP_Extension

+ 1 - 0
config/nginx.conf

@@ -32,6 +32,7 @@ http {
     fastcgi_buffers 4 64k;
     fastcgi_busy_buffers_size 128k;
     fastcgi_temp_file_write_size 128k;
+    fastcgi_intercept_errors on;
 
     #Gzip Compression
     gzip on;

+ 1 - 0
config/nginx_apache.conf

@@ -32,6 +32,7 @@ http {
     fastcgi_buffers 4 64k;
     fastcgi_busy_buffers_size 128k;
     fastcgi_temp_file_write_size 128k;
+    fastcgi_intercept_errors on;
 
     #Gzip Compression
     gzip on;

+ 1 - 0
config/nginx_tomcat.conf

@@ -32,6 +32,7 @@ http {
     fastcgi_buffers 4 64k;
     fastcgi_busy_buffers_size 128k;
     fastcgi_temp_file_write_size 128k;
+    fastcgi_intercept_errors on;
 
     #Gzip Compression
     gzip on;

+ 33 - 32
include/GraphicsMagick.sh

@@ -9,43 +9,44 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_GraphicsMagick() {
-cd $oneinstack_dir/src
-tar xzf GraphicsMagick-$GraphicsMagick_version.tar.gz
-cd GraphicsMagick-$GraphicsMagick_version
-./configure --prefix=/usr/local/graphicsmagick --enable-shared --enable-static
-make -j ${THREAD} && make install
-cd ..
-rm -rf GraphicsMagick-$GraphicsMagick_version
-cd ..
+    pushd $oneinstack_dir/src
+    tar xzf GraphicsMagick-$GraphicsMagick_version.tar.gz
+    pushd GraphicsMagick-$GraphicsMagick_version
+    ./configure --prefix=/usr/local/graphicsmagick --enable-shared --enable-static
+    make -j ${THREAD} && make install
+    popd
+    rm -rf GraphicsMagick-$GraphicsMagick_version
+    popd
 }
 
 Install_php-gmagick() {
-cd $oneinstack_dir/src
-if [ -e "$php_install_dir/bin/phpize" ];then
-    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
-        tar xzf gmagick-2.0.4RC1.tgz
-        cd gmagick-2.0.4RC1
-    else
-        tar xzf gmagick-$gmagick_version.tgz
-        cd gmagick-$gmagick_version
-    fi
-    make clean
-    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-    $php_install_dir/bin/phpize
-    ./configure --with-php-config=$php_install_dir/bin/php-config --with-gmagick=/usr/local/graphicsmagick
-    make -j ${THREAD} && make install
-    cd ..
-    rm -rf gmagick-$gmagick_version
-
-    if [ -f "`$php_install_dir/bin/php-config --extension-dir`/gmagick.so" ];then
-        cat > $php_install_dir/etc/php.d/ext-gmagick.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    if [ -e "$php_install_dir/bin/phpize" ];then
+        if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
+            tar xzf gmagick-2.0.4RC1.tgz
+            pushd gmagick-2.0.4RC1
+        else
+            tar xzf gmagick-$gmagick_version.tgz
+            pushd gmagick-$gmagick_version
+        fi
+        make clean
+        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+        $php_install_dir/bin/phpize
+        ./configure --with-php-config=$php_install_dir/bin/php-config --with-gmagick=/usr/local/graphicsmagick
+        make -j ${THREAD} && make install
+        popd
+        rm -rf gmagick-$gmagick_version
+    
+        if [ -f "${phpExtensionDir}/gmagick.so" ];then
+            cat > $php_install_dir/etc/php.d/ext-gmagick.ini << EOF
 [gmagick]
 extension=gmagick.so
 EOF
-        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-    else
-        echo "${CFAILURE}PHP gmagick module install failed, Please contact the author! ${CEND}"
+            [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+        else
+            echo "${CFAILURE}PHP gmagick module install failed, Please contact the author! ${CEND}"
+        fi
     fi
-fi
-cd ..
+    popd
 }

+ 33 - 32
include/ImageMagick.sh

@@ -9,43 +9,44 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_ImageMagick() {
-cd $oneinstack_dir/src
-tar xzf ImageMagick-$ImageMagick_version.tar.gz
-cd ImageMagick-$ImageMagick_version
-./configure --prefix=/usr/local/imagemagick --enable-shared --enable-static
-make -j ${THREAD} && make install
-cd ..
-rm -rf ImageMagick-$ImageMagick_version
-cd ..
+    pushd $oneinstack_dir/src
+    tar xzf ImageMagick-$ImageMagick_version.tar.gz
+    pushd ImageMagick-$ImageMagick_version
+    ./configure --prefix=/usr/local/imagemagick --enable-shared --enable-static
+    make -j ${THREAD} && make install
+    popd
+    rm -rf ImageMagick-$ImageMagick_version
+    popd
 }
 
 Install_php-imagick() {
-cd $oneinstack_dir/src
-if [ -e "$php_install_dir/bin/phpize" ];then
-    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1"."$2}'`" == '5.3' ];then
-        tar xzf imagick-${imagick_for_php53_version}.tgz
-        cd imagick-${imagick_for_php53_version}
-    else
-        tar xzf imagick-$imagick_version.tgz
-        cd imagick-$imagick_version
-    fi
-    make clean
-    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-    $php_install_dir/bin/phpize
-    ./configure --with-php-config=$php_install_dir/bin/php-config --with-imagick=/usr/local/imagemagick
-    make -j ${THREAD} && make install
-    cd ..
-    rm -rf imagick-$imagick_version
-
-    if [ -f "`$php_install_dir/bin/php-config --extension-dir`/imagick.so" ];then
-        cat > $php_install_dir/etc/php.d/ext-imagick.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    if [ -e "$php_install_dir/bin/phpize" ];then
+        if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1"."$2}'`" == '5.3' ];then
+            tar xzf imagick-${imagick_for_php53_version}.tgz
+            pushd imagick-${imagick_for_php53_version}
+        else
+            tar xzf imagick-$imagick_version.tgz
+            pushd imagick-$imagick_version
+        fi
+        make clean
+        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+        $php_install_dir/bin/phpize
+        ./configure --with-php-config=$php_install_dir/bin/php-config --with-imagick=/usr/local/imagemagick
+        make -j ${THREAD} && make install
+        popd
+        rm -rf imagick-$imagick_version
+    
+        if [ -f "${phpExtensionDir}/imagick.so" ];then
+            cat > $php_install_dir/etc/php.d/ext-imagick.ini << EOF
 [imagick]
 extension=imagick.so
 EOF
-        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-    else
-        echo "${CFAILURE}PHP imagick module install failed, Please contact the author! ${CEND}"
+            [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+        else
+            echo "${CFAILURE}PHP imagick module install failed, Please contact the author! ${CEND}"
+        fi
     fi
-fi
-cd ..
+    popd
 }

+ 63 - 63
include/ZendGuardLoader.sh

@@ -9,74 +9,74 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_ZendGuardLoader() {
-cd $oneinstack_dir/src
+    pushd ${oneinstack_dir}/src
+    PHP_detail_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
+    PHP_main_version=${PHP_detail_version%.*}
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
 
-PHP_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
-PHP_main_version=${PHP_version%.*}
-
-[ ! -d "`$php_install_dir/bin/php-config --extension-dir`" ] && mkdir -p `$php_install_dir/bin/php-config --extension-dir`
-if [ "$OS_BIT" == '64' ];then
-    if [ "$PHP_main_version" == '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 `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf zend-loader-php5.6-linux-x86_64
-    fi
-
-    if [ "$PHP_main_version" == '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 `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf zend-loader-php5.5-linux-x86_64
-    fi
-
-    if [ "$PHP_main_version" == '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 `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
-    fi
-
-    if [ "$PHP_main_version" == '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 `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf ZendGuardLoader-php-5.3-linux-glibc23-x86_64
-    fi
-else
-    if [ "$PHP_main_version" == '5.6' ];then
-        tar xzf zend-loader-php5.6-linux-i386.tar.gz
-        /bin/cp zend-loader-php5.6-linux-i386/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf zend-loader-php5.6-linux-i386
+    [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
+    if [ "$OS_BIT" == '64' ];then
+        if [ "$PHP_main_version" == '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_version" == '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_version" == '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_version" == '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_version" == '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_version" == '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_version" == '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_version" == '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 [ "$PHP_main_version" == '5.5' ];then
-        tar xzf zend-loader-php5.5-linux-i386.tar.gz
-        /bin/cp zend-loader-php5.5-linux-i386/ZendGuardLoader.so `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf zend-loader-php5.5-linux-x386
-    fi
-
-    if [ "$PHP_main_version" == '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 `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386
-    fi
-
-    if [ "$PHP_main_version" == '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 `$php_install_dir/bin/php-config --extension-dir`
-        rm -rf ZendGuardLoader-php-5.3-linux-glibc23-i386
-    fi
-fi
-
-if [ -f "`$php_install_dir/bin/php-config --extension-dir`/ZendGuardLoader.so" ];then
-    cat > $php_install_dir/etc/php.d/ext-ZendGuardLoader.ini << EOF
+    
+    if [ -f "${phpExtensionDir}/ZendGuardLoader.so" ];then
+        cat > $php_install_dir/etc/php.d/ext-ZendGuardLoader.ini << EOF
 [Zend Guard Loader]
-zend_extension=`$php_install_dir/bin/php-config --extension-dir`/ZendGuardLoader.so
+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}"
-    [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-else
-    echo "${CFAILURE}PHP ZendGuardLoader module install failed, Please contact the author! ${CEND}"
-fi
-cd ..
+        echo "${CSUCCESS}PHP ZendGuardLoader module installed successfully! ${CEND}"
+        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+    else
+        echo "${CFAILURE}PHP ZendGuardLoader module install failed, Please contact the author! ${CEND}"
+    fi
+    popd
 }

+ 24 - 18
include/apcu.sh

@@ -9,15 +9,21 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_APCU() {
-cd $oneinstack_dir/src
-tar xzf apcu-$apcu_version.tgz
-cd apcu-$apcu_version
-make clean
-$php_install_dir/bin/phpize
-./configure --with-php-config=$php_install_dir/bin/php-config
-make -j ${THREAD} && make install
-if [ -f "`$php_install_dir/bin/php-config --extension-dir`/apcu.so" ];then
-    cat > $php_install_dir/etc/php.d/ext-apcu.ini << EOF
+    pushd ${oneinstack_dir}/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
+        tar xzf apcu-${apcu_for_php7_version}.tgz
+        pushd apcu-${apcu_for_php7_version}
+    else
+        tar xzf apcu-${apcu_version}.tgz
+        pushd apcu-${apcu_version}
+    fi
+  
+    ${php_install_dir}/bin/phpize
+    ./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
 [apcu]
 extension=apcu.so
 apc.enabled=1
@@ -25,13 +31,13 @@ apc.shm_size=32M
 apc.ttl=7200
 apc.enable_cli=1
 EOF
-    [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-    /bin/cp apc.php $wwwroot_dir/default
-    echo "${CSUCCESS}APCU module installed successfully! ${CEND}"
-    cd ..
-    rm -rf apcu-$apcu_version
-else
-    echo "${CFAILURE}APCU module install failed, Please contact the author! ${CEND}"
-fi
-cd ..
+        [ "${Apache_version}" != '1' -a "${Apache_version}" != '2' ] && service php-fpm restart || service httpd restart
+        /bin/cp apc.php ${wwwroot_dir}/default
+        echo "${CSUCCESS}APCU module installed successfully! ${CEND}"
+    else
+        echo "${CFAILURE}APCU module install failed, Please contact the author! ${CEND}"
+    fi
+    popd
+    rm -rf apcu-${apcu_version}
+    popd
 }

+ 18 - 10
include/check_download.sh

@@ -234,7 +234,7 @@ checkDownload() {
                 let "tryDlCount++"
                 [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MARAIDB_TAR_MD5}" -o "${tryDlCount}" == "6" ] && break || continue
             done
-            if [ "${tryDlCount}" == "6" -o "${tryDlCount}" == "6" ];then
+            if [ "${tryDlCount}" == "6" ];then
                 echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
                 kill -9 $$
             else
@@ -273,7 +273,7 @@ checkDownload() {
                 let "tryDlCount++"
                 [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MARAIDB_TAR_MD5}" -o "${tryDlCount}" == "6" ] && break || continue
             done
-            if [ "${tryDlCount}" == "6" -o "${tryDlCount}" == "6" ];then
+            if [ "${tryDlCount}" == "6" ];then
                 echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
                 kill -9 $$
             else
@@ -311,7 +311,7 @@ checkDownload() {
                 let "tryDlCount++"
                 [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MARAIDB_TAR_MD5}" -o "${tryDlCount}" == "6" ] && break || continue
             done
-            if [ "${tryDlCount}" == "6" -o "${tryDlCount}" == "6" ];then
+            if [ "${tryDlCount}" == "6" ];then
                 echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
                 kill -9 $$
             else
@@ -345,7 +345,7 @@ checkDownload() {
                 let "tryDlCount++"
                 [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PERCONA_TAR_MD5}" -o "${tryDlCount}" == "6" ] && break || continue
             done
-            if [ "${tryDlCount}" == "6" -o "${tryDlCount}" == "6" ];then
+            if [ "${tryDlCount}" == "6" ];then
                 echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
                 kill -9 $$
             else
@@ -380,7 +380,7 @@ checkDownload() {
                 let "tryDlCount++"
                 [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PERCONA_TAR_MD5}" -o "${tryDlCount}" == "6" ] && break || continue
             done
-            if [ "${tryDlCount}" == "6" -o "${tryDlCount}" == "6" ];then
+            if [ "${tryDlCount}" == "6" ];then
                 echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
                 kill -9 $$
             else
@@ -475,10 +475,14 @@ checkDownload() {
             echo "Download xcache..."
             src_url=http://xcache.lighttpd.net/pub/Releases/${xcache_version}/xcache-${xcache_version}.tar.gz && Download_src
         fi
-        if [ "${PHP_cache}" == "3" ] && [[ "$PHP_version" =~ ^[1-3]$ ]];then
-            # php 5.3 5.4 5.5
+        if [ "${PHP_cache}" == "3" ];then
+            # php 5.3 5.4 5.5 5.6 7.0
             echo "Download apcu..."
-            src_url=http://pecl.php.net/get/apcu-${apcu_version}.tgz && Download_src
+            if [ "${PHP_version}" != "5" ]; then
+                src_url=http://pecl.php.net/get/apcu-${apcu_version}.tgz && Download_src
+            else
+                src_url=http://pecl.php.net/get/apcu-${apcu_for_php7_version}.tgz && Download_src
+            fi
         fi
         if [ "${PHP_cache}" == "4" -a "${PHP_version}" == "2" ];then
             echo "Download eaccelerator 1.0 dev..."
@@ -489,7 +493,7 @@ checkDownload() {
         fi
       
         # Zend Guard Loader
-        if [ "${ZendGuardLoader_yn}" == "y" ];then
+        if [ "${ZendGuardLoader_yn}" == "y" -a "${armPlatform}" != "y" ];then
             if [ "${PHP_version}" == "4" ];then
                 if [ "${OS_BIT}" == "64" ];then
                     # 64 bit
@@ -541,7 +545,11 @@ checkDownload() {
             if [ "${OS_BIT}" == '64' ];then
                 src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && Download_src
             else
-                src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.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
+                    src_url=http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz && Download_src
+                fi
             fi
         fi
       

+ 11 - 4
include/check_os.sh

@@ -34,6 +34,17 @@ else
     kill -9 $$
 fi
 
+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
+fi
+
 if [ $(getconf WORD_BIT) == 32 ] && [ $(getconf LONG_BIT) == 64 ];then
     OS_BIT=64
     SYS_BIG_FLAG=x64 #jdk
@@ -47,10 +58,6 @@ 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
-    armTarget="y"
-fi
-
 THREAD=$(grep 'processor' /proc/cpuinfo | sort -u | wc -l)
 
 # Percona

+ 22 - 21
include/eaccelerator-0.9.sh

@@ -9,19 +9,20 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_eAccelerator-0-9() {
-cd $oneinstack_dir/src
-tar jxf eaccelerator-${eaccelerator_version}.tar.bz2
-cd eaccelerator-${eaccelerator_version}
-make clean
-$php_install_dir/bin/phpize
-./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config
-make -j ${THREAD} && make install
-
-if [ -f "`$php_install_dir/bin/php-config --extension-dir`/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
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    tar jxf eaccelerator-${eaccelerator_version}.tar.bz2
+    pushd eaccelerator-${eaccelerator_version}
+    make clean
+    $php_install_dir/bin/phpize
+    ./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config
+    make -j ${THREAD} && make install
+    
+    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
 [eaccelerator]
-zend_extension=`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so
+zend_extension=${phpExtensionDir}/eaccelerator.so
 eaccelerator.shm_size=64
 eaccelerator.cache_dir=/var/eaccelerator_cache
 eaccelerator.enable=1
@@ -39,13 +40,13 @@ eaccelerator.keys=disk_only
 eaccelerator.sessions=disk_only
 eaccelerator.content=disk_only
 EOF
-    echo "${CSUCCESS}Accelerator module installed successfully! ${CEND}"
-    cd ..
-    [ -z "`grep 'kernel.shmmax = 67108864' /etc/sysctl.conf`" ] && echo 'kernel.shmmax = 67108864' >> /etc/sysctl.conf
-    sysctl -p
-    [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-else
-    echo "${CFAILURE}Accelerator module install failed, Please contact the author! ${CEND}"
-fi
-cd ..
+        echo "${CSUCCESS}Accelerator module installed successfully! ${CEND}"
+        popd
+        [ -z "`grep 'kernel.shmmax = 67108864' /etc/sysctl.conf`" ] && echo 'kernel.shmmax = 67108864' >> /etc/sysctl.conf
+        sysctl -p
+        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+    else
+        echo "${CFAILURE}Accelerator module install failed, Please contact the author! ${CEND}"
+    fi
+    popd
 }

+ 22 - 21
include/eaccelerator-1.0-dev.sh

@@ -9,19 +9,20 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_eAccelerator-1-0-dev() {
-cd $oneinstack_dir/src
-/bin/mv master eaccelerator-eaccelerator-42067ac.tar.gz
-tar xzf eaccelerator-eaccelerator-42067ac.tar.gz
-cd eaccelerator-eaccelerator-42067ac
-make clean
-$php_install_dir/bin/phpize
-./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config
-make -j ${THREAD} && make install
-if [ -f "`$php_install_dir/bin/php-config --extension-dir`/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
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    /bin/mv master eaccelerator-eaccelerator-42067ac.tar.gz
+    tar xzf eaccelerator-eaccelerator-42067ac.tar.gz
+    pushd eaccelerator-eaccelerator-42067ac
+    make clean
+    $php_install_dir/bin/phpize
+    ./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config
+    make -j ${THREAD} && make install
+    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
 [eaccelerator]
-zend_extension=`$php_install_dir/bin/php-config --extension-dir`/eaccelerator.so
+zend_extension=${phpExtensionDir}/eaccelerator.so
 eaccelerator.shm_size=64
 eaccelerator.cache_dir=/var/eaccelerator_cache
 eaccelerator.enable=1
@@ -39,13 +40,13 @@ eaccelerator.keys=disk_only
 eaccelerator.sessions=disk_only
 eaccelerator.content=disk_only
 EOF
-    echo "${CSUCCESS}Accelerator module installed successfully! ${CEND}"
-    cd ..
-    [ -z "`grep 'kernel.shmmax = 67108864' /etc/sysctl.conf`" ] && echo 'kernel.shmmax = 67108864' >> /etc/sysctl.conf
-    sysctl -p
-    [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-else
-    echo "${CFAILURE}Accelerator module install failed, Please contact the author! ${CEND}"
-fi
-cd ..
+        echo "${CSUCCESS}Accelerator module installed successfully! ${CEND}"
+        popd 
+        [ -z "`grep 'kernel.shmmax = 67108864' /etc/sysctl.conf`" ] && echo 'kernel.shmmax = 67108864' >> /etc/sysctl.conf
+        sysctl -p
+        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+    else
+        echo "${CFAILURE}Accelerator module install failed, Please contact the author! ${CEND}"
+    fi
+    popd
 }

+ 43 - 33
include/ioncube.sh

@@ -9,39 +9,49 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_ionCube() {
-cd $oneinstack_dir/src
-
-PHP_version=`$php_install_dir/bin/php -r 'echo PHP_VERSION;'`
-PHP_main_version=${PHP_version%.*}
-
-if [ "$OS_BIT" == '64' ];then
-    tar xzf ioncube_loaders_lin_x86-64.tar.gz
-else
-    tar xzf ioncube_loaders_lin_x86.tar.gz
-fi
-
-[ ! -d "`$php_install_dir/bin/php-config --extension-dir`" ] && mkdir -p `$php_install_dir/bin/php-config --extension-dir`
-if [ "$PHP_main_version" == '5.6' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.6.so `$php_install_dir/bin/php-config --extension-dir`
-    zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.6.so"
-elif [ "$PHP_main_version" == '5.5' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.5.so `$php_install_dir/bin/php-config --extension-dir`
-    zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.5.so"
-elif [ "$PHP_main_version" == '5.4' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.4.so `$php_install_dir/bin/php-config --extension-dir`
-    zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.4.so"
-elif [ "$PHP_main_version" == '5.3' ];then
-    /bin/cp ioncube/ioncube_loader_lin_5.3.so `$php_install_dir/bin/php-config --extension-dir`
-    zend_extension="`$php_install_dir/bin/php-config --extension-dir`/ioncube_loader_lin_5.3.so"
-else
-    exit 1
-fi
-
-rm -rf ioncube
-cat > $php_install_dir/etc/php.d/ext-0ioncube.ini << EOF
+    pushd ${oneinstack_dir}/src
+  
+    PHP_detail_version=$(${php_install_dir}/bin/php -r 'echo PHP_VERSION;')
+    PHP_main_version=${PHP_detail_version%.*}
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+  
+    if [ "${OS_BIT}" == '64' ];then
+        tar xzf ioncube_loaders_lin_x86-64.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
+    fi
+  
+    [ ! -d "${phpExtensionDir}" ] && mkdir -p ${phpExtensionDir}
+    if [ "$PHP_main_version" == '7.0' ]; then
+        /bin/cp ioncube/ioncube_loader_lin_7.0.so ${phpExtensionDir}
+        zend_extension="${phpExtensionDir}/ioncube_loader_lin_7.0.so"
+    elif [ "$PHP_main_version" == '5.6' ]; then
+        /bin/cp ioncube/ioncube_loader_lin_5.6.so ${phpExtensionDir}
+        zend_extension="${phpExtensionDir}/ioncube_loader_lin_5.6.so"
+    elif [ "$PHP_main_version" == '5.5' ]; then
+        /bin/cp ioncube/ioncube_loader_lin_5.5.so ${phpExtensionDir}
+        zend_extension="${phpExtensionDir}/ioncube_loader_lin_5.5.so"
+    elif [ "$PHP_main_version" == '5.4' ]; then
+        /bin/cp ioncube/ioncube_loader_lin_5.4.so ${phpExtensionDir}
+        zend_extension="${phpExtensionDir}/ioncube_loader_lin_5.4.so"
+    elif [ "$PHP_main_version" == '5.3' ]; then
+        /bin/cp ioncube/ioncube_loader_lin_5.3.so ${phpExtensionDir}
+        zend_extension="${phpExtensionDir}/ioncube_loader_lin_5.3.so"
+    else
+        echo "Error! Your PHP ${PHP_detail_version} does not support ionCube!"
+        rm -rf ioncube
+        exit 1
+    fi
+  
+    rm -rf ioncube
+    cat > ${php_install_dir}/etc/php.d/ext-0ioncube.ini << EOF
 [ionCube Loader]
-zend_extension=$zend_extension
+zend_extension=${zend_extension}
 EOF
-[ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-cd ..
+    [ "${Apache_version}" != '1' -a "${Apache_version}" != '2' ] && service php-fpm restart || service httpd restart
+    popd
 }

+ 1 - 1
include/mariadb-5.5.sh

@@ -36,7 +36,7 @@ Install_MariaDB-5-5() {
       EXE_LINKER="-DCMAKE_EXE_LINKER_FLAGS='-ltcmalloc'"
     fi
     
-    if [ "${armTarget}" == "y" ];then
+    if [ "${armPlatform}" == "y" ];then
       patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
     fi
 

+ 91 - 89
include/memcached.sh

@@ -9,106 +9,108 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_memcached() {
-cd $oneinstack_dir/src
-
-# memcached server
-id -u memcached >/dev/null 2>&1
-[ $? -ne 0 ] && useradd -M -s /sbin/nologin memcached
-
-tar xzf memcached-$memcached_version.tar.gz
-cd memcached-$memcached_version
-[ ! -d "$memcached_install_dir" ] && mkdir -p $memcached_install_dir
-./configure --prefix=$memcached_install_dir
-make -j ${THREAD} && make install
-if [ -d "$memcached_install_dir/include/memcached" ];then
-    echo "${CSUCCESS}memcached installed successfully! ${CEND}"
-    cd ..
-    rm -rf memcached-$memcached_version
-    ln -s $memcached_install_dir/bin/memcached /usr/bin/memcached
-    [ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Memcached-init-CentOS /etc/init.d/memcached; chkconfig --add memcached; chkconfig memcached on; }
-    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Memcached-init-Ubuntu /etc/init.d/memcached; update-rc.d memcached defaults; }
-    sed -i "s@/usr/local/memcached@$memcached_install_dir@g" /etc/init.d/memcached
-    [ -n "`grep 'CACHESIZE=' /etc/init.d/memcached`" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=`expr $Mem / 8`@" /etc/init.d/memcached
-    [ -n "`grep 'start_instance default 256;' /etc/init.d/memcached`" ] && sed -i "s@start_instance default 256;@start_instance default `expr $Mem / 8`;@" /etc/init.d/memcached
-    service memcached start
-else
-    rm -rf $memcached_install_dir
-    echo "${CFAILURE}memcached install failed, Please contact the author! ${CEND}"
-    kill -9 $$
-fi
-cd ..
+    pushd $oneinstack_dir/src
+    
+    # memcached server
+    id -u memcached >/dev/null 2>&1
+    [ $? -ne 0 ] && useradd -M -s /sbin/nologin memcached
+    
+    tar xzf memcached-$memcached_version.tar.gz
+    pushd memcached-$memcached_version
+    [ ! -d "$memcached_install_dir" ] && mkdir -p $memcached_install_dir
+    ./configure --prefix=$memcached_install_dir
+    make -j ${THREAD} && make install
+    if [ -d "$memcached_install_dir/include/memcached" ];then
+        echo "${CSUCCESS}memcached installed successfully! ${CEND}"
+        popd 
+        rm -rf memcached-$memcached_version
+        ln -s $memcached_install_dir/bin/memcached /usr/bin/memcached
+        [ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Memcached-init-CentOS /etc/init.d/memcached; chkconfig --add memcached; chkconfig memcached on; }
+        [[ $OS =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Memcached-init-Ubuntu /etc/init.d/memcached; update-rc.d memcached defaults; }
+        sed -i "s@/usr/local/memcached@$memcached_install_dir@g" /etc/init.d/memcached
+        [ -n "`grep 'CACHESIZE=' /etc/init.d/memcached`" ] && sed -i "s@^CACHESIZE=.*@CACHESIZE=`expr $Mem / 8`@" /etc/init.d/memcached
+        [ -n "`grep 'start_instance default 256;' /etc/init.d/memcached`" ] && sed -i "s@start_instance default 256;@start_instance default `expr $Mem / 8`;@" /etc/init.d/memcached
+        service memcached start
+    else
+        rm -rf $memcached_install_dir
+        echo "${CFAILURE}memcached install failed, Please contact the author! ${CEND}"
+        kill -9 $$
+    fi
+    popd
 }
 
 Install_php-memcache() {
-cd $oneinstack_dir/src
-if [ -e "$php_install_dir/bin/phpize" ];then
-    # php memcache extension
-    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
-        #git clone https://github.com/websupport-sk/pecl-memcache.git
-        #cd pecl-memcache
-        tar xzf pecl-memcache-php7.tgz
-        cd pecl-memcache-php7
-    else
-        tar xzf memcache-$memcache_pecl_version.tgz
-        cd memcache-$memcache_pecl_version
-    fi
-    make clean
-    $php_install_dir/bin/phpize
-    ./configure --with-php-config=$php_install_dir/bin/php-config
-    make -j ${THREAD} && make install
-    if [ -f "`$php_install_dir/bin/php-config --extension-dir`/memcache.so" ];then
-        cat > $php_install_dir/etc/php.d/ext-memcache.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    if [ -e "$php_install_dir/bin/phpize" ];then
+        # php memcache extension
+        if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
+            #git clone https://github.com/websupport-sk/pecl-memcache.git
+            #cd pecl-memcache
+            tar xzf pecl-memcache-php7.tgz
+            pushd pecl-memcache-php7
+        else
+            tar xzf memcache-$memcache_pecl_version.tgz
+            pushd memcache-$memcache_pecl_version
+        fi
+        make clean
+        $php_install_dir/bin/phpize
+        ./configure --with-php-config=$php_install_dir/bin/php-config
+        make -j ${THREAD} && make install
+        if [ -f "${phpExtensionDir}/memcache.so" ];then
+            cat > $php_install_dir/etc/php.d/ext-memcache.ini << EOF
 extension=memcache.so
 EOF
-        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-        echo "${CSUCCESS}PHP memcache module installed successfully! ${CEND}"
-        cd ..
-        rm -rf memcache-$memcache_pecl_version
-    else
-        echo "${CFAILURE}PHP memcache module install failed, Please contact the author! ${CEND}"
+            [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+            echo "${CSUCCESS}PHP memcache module installed successfully! ${CEND}"
+            popd
+            rm -rf memcache-$memcache_pecl_version
+        else
+            echo "${CFAILURE}PHP memcache module install failed, Please contact the author! ${CEND}"
+        fi
     fi
-fi
-cd ..
+    popd
 }
 
 Install_php-memcached() {
-cd $oneinstack_dir/src
-if [ -e "$php_install_dir/bin/phpize" ];then
-    # php memcached extension
-    tar xzf libmemcached-$libmemcached_version.tar.gz
-    cd libmemcached-$libmemcached_version
-    [ "$OS" == 'CentOS' ] && yum -y install cyrus-sasl-devel
-    [[ $OS =~ ^Ubuntu$|^Debian$ ]] && sed -i "s@lthread -pthread -pthreads@lthread -lpthread -pthreads@" ./configure
-    ./configure --with-memcached=$memcached_install_dir
-    make -j ${THREAD} && make install
-    cd ..
-    rm -rf libmemcached-$libmemcached_version
-
-    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
-        #git clone -b php7 https://github.com/php-memcached-dev/php-memcached.git
-        #cd php-memcached
-        tar xzf php-memcached-php7.tgz
-        cd php-memcached-php7
-    else
-        tar xzf memcached-$memcached_pecl_version.tgz
-        cd memcached-$memcached_pecl_version
-    fi
-    make clean
-    $php_install_dir/bin/phpize
-    ./configure --with-php-config=$php_install_dir/bin/php-config
-    make -j ${THREAD} && make install
-    if [ -f "`$php_install_dir/bin/php-config --extension-dir`/memcached.so" ];then
-        cat > $php_install_dir/etc/php.d/ext-memcached.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    if [ -e "$php_install_dir/bin/phpize" ];then
+        # php memcached extension
+        tar xzf libmemcached-$libmemcached_version.tar.gz
+        pushd libmemcached-$libmemcached_version
+        [ "$OS" == 'CentOS' ] && yum -y install cyrus-sasl-devel
+        [[ $OS =~ ^Ubuntu$|^Debian$ ]] && sed -i "s@lthread -pthread -pthreads@lthread -lpthread -pthreads@" ./configure
+        ./configure --with-memcached=$memcached_install_dir
+        make -j ${THREAD} && make install
+        popd
+        rm -rf libmemcached-$libmemcached_version
+    
+        if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
+            #git clone -b php7 https://github.com/php-memcached-dev/php-memcached.git
+            #cd php-memcached
+            tar xzf php-memcached-php7.tgz
+            pushd php-memcached-php7
+        else
+            tar xzf memcached-$memcached_pecl_version.tgz
+            pushd memcached-$memcached_pecl_version
+        fi
+        make clean
+        $php_install_dir/bin/phpize
+        ./configure --with-php-config=$php_install_dir/bin/php-config
+        make -j ${THREAD} && make install
+        if [ -f "${phpExtensionDir}/memcached.so" ];then
+            cat > $php_install_dir/etc/php.d/ext-memcached.ini << EOF
 extension=memcached.so
 memcached.use_sasl=1
 EOF
-        echo "${CSUCCESS}PHP memcached module installed successfully! ${CEND}"
-        cd ..
-        rm -rf memcached-$memcached_pecl_version
-        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-    else
-        echo "${CFAILURE}PHP memcached module install failed, Please contact the author! ${CEND}"
+            echo "${CSUCCESS}PHP memcached module installed successfully! ${CEND}"
+            popd 
+            rm -rf memcached-$memcached_pecl_version
+            [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+        else
+            echo "${CFAILURE}PHP memcached module install failed, Please contact the author! ${CEND}"
+        fi
     fi
-fi
-cd ..
+    popd
 }

+ 1 - 1
include/mysql-5.5.sh

@@ -36,7 +36,7 @@ Install_MySQL-5-5() {
       EXE_LINKER="-DCMAKE_EXE_LINKER_FLAGS='-ltcmalloc'"
     fi
     
-    [ "${armTarget}" == "y" ] && patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
+    [ "${armPlatform}" == "y" ] && patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
 
     cmake . -DCMAKE_INSTALL_PREFIX=${mysql_install_dir} \
     -DMYSQL_DATADIR=${mysql_data_dir} \

+ 1 - 1
include/percona-5.5.sh

@@ -37,7 +37,7 @@ Install_Percona-5-5() {
       EXE_LINKER="-DCMAKE_EXE_LINKER_FLAGS='-ltcmalloc'"
     fi
 
-    if [ "${armTarget}" == "y" ];then
+    if [ "${armPlatform}" == "y" ];then
       patch -p1 < ../mysql-5.5-fix-arm-client_plugin.patch
     fi
 

+ 1 - 1
include/php-7.sh → include/php-7.0.sh

@@ -8,7 +8,7 @@
 #       https://oneinstack.com
 #       https://github.com/lj2007331/oneinstack
 
-Install_PHP-7() {
+Install_PHP-7-0() {
 cd $oneinstack_dir/src
 
 tar xzf libiconv-$libiconv_version.tar.gz

+ 10 - 10
include/phpmyadmin.sh

@@ -9,14 +9,14 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_phpMyAdmin() {
-cd $oneinstack_dir/src
-tar xzf phpMyAdmin-${phpMyAdmin_version}-all-languages.tar.gz
-/bin/mv phpMyAdmin-${phpMyAdmin_version}-all-languages $wwwroot_dir/default/phpMyAdmin
-/bin/cp $wwwroot_dir/default/phpMyAdmin/{config.sample.inc.php,config.inc.php}
-mkdir $wwwroot_dir/default/phpMyAdmin/{upload,save}
-sed -i "s@UploadDir.*@UploadDir'\] = 'upload';@" $wwwroot_dir/default/phpMyAdmin/config.inc.php
-sed -i "s@SaveDir.*@SaveDir'\] = 'save';@" $wwwroot_dir/default/phpMyAdmin/config.inc.php
-sed -i "s@blowfish_secret.*;@blowfish_secret\'\] = \'`cat /dev/urandom | head -1 | md5sum | head -c 10`\';@" $wwwroot_dir/default/phpMyAdmin/config.inc.php
-chown -R ${run_user}.$run_user $wwwroot_dir/default/phpMyAdmin
-cd ..
+    pushd $oneinstack_dir/src
+    tar xzf phpMyAdmin-${phpMyAdmin_version}-all-languages.tar.gz
+    /bin/mv phpMyAdmin-${phpMyAdmin_version}-all-languages $wwwroot_dir/default/phpMyAdmin
+    /bin/cp $wwwroot_dir/default/phpMyAdmin/{config.sample.inc.php,config.inc.php}
+    mkdir $wwwroot_dir/default/phpMyAdmin/{upload,save}
+    sed -i "s@UploadDir.*@UploadDir'\] = 'upload';@" $wwwroot_dir/default/phpMyAdmin/config.inc.php
+    sed -i "s@SaveDir.*@SaveDir'\] = 'save';@" $wwwroot_dir/default/phpMyAdmin/config.inc.php
+    sed -i "s@blowfish_secret.*;@blowfish_secret\'\] = \'`cat /dev/urandom | head -1 | md5sum | head -c 10`\';@" $wwwroot_dir/default/phpMyAdmin/config.inc.php
+    chown -R ${run_user}.$run_user $wwwroot_dir/default/phpMyAdmin
+    popd
 }

+ 69 - 68
include/redis.sh

@@ -9,80 +9,81 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_redis-server() {
-cd $oneinstack_dir/src
-tar xzf redis-$redis_version.tar.gz
-cd redis-$redis_version
-if [ "$OS_BIT" == '32' ];then
-    sed -i '1i\CFLAGS= -march=i686' src/Makefile
-    sed -i 's@^OPT=.*@OPT=-O2 -march=i686@' src/.make-settings
-fi
-
-make -j ${THREAD}
-
-if [ -f "src/redis-server" ];then
-    mkdir -p $redis_install_dir/{bin,etc,var}
-    /bin/cp src/{redis-benchmark,redis-check-aof,redis-check-rdb,redis-cli,redis-sentinel,redis-server} $redis_install_dir/bin/
-    /bin/cp redis.conf $redis_install_dir/etc/
-    ln -s $redis_install_dir/bin/* /usr/local/bin/
-    sed -i 's@pidfile.*@pidfile /var/run/redis.pid@' $redis_install_dir/etc/redis.conf
-    sed -i "s@logfile.*@logfile $redis_install_dir/var/redis.log@" $redis_install_dir/etc/redis.conf
-    sed -i "s@^dir.*@dir $redis_install_dir/var@" $redis_install_dir/etc/redis.conf
-    sed -i 's@daemonize no@daemonize yes@' $redis_install_dir/etc/redis.conf
-    sed -i "s@^# bind 127.0.0.1@bind 127.0.0.1@" $redis_install_dir/etc/redis.conf
-    redis_maxmemory=`expr $Mem / 8`000000
-    [ -z "`grep ^maxmemory $redis_install_dir/etc/redis.conf`" ] && sed -i "s@maxmemory <bytes>@maxmemory <bytes>\nmaxmemory `expr $Mem / 8`000000@" $redis_install_dir/etc/redis.conf
-    echo "${CSUCCESS}Redis-server installed successfully! ${CEND}"
-    cd ..
-    rm -rf redis-$redis_version
-    id -u redis >/dev/null 2>&1
-    [ $? -ne 0 ] && useradd -M -s /sbin/nologin redis
-    chown -R redis:redis $redis_install_dir/var
-    /bin/cp ../init.d/Redis-server-init /etc/init.d/redis-server
-    if [ "$OS" == 'CentOS' ];then
-        cc start-stop-daemon.c -o /sbin/start-stop-daemon
-        chkconfig --add redis-server
-        chkconfig redis-server on
-    elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then
-        update-rc.d redis-server defaults
+    pushd $oneinstack_dir/src
+    tar xzf redis-$redis_version.tar.gz
+    pushd redis-$redis_version
+    if [ "$OS_BIT" == '32' ];then
+        sed -i '1i\CFLAGS= -march=i686' src/Makefile
+        sed -i 's@^OPT=.*@OPT=-O2 -march=i686@' src/.make-settings
+    fi
+    
+    make -j ${THREAD}
+    
+    if [ -f "src/redis-server" ];then
+        mkdir -p $redis_install_dir/{bin,etc,var}
+        /bin/cp src/{redis-benchmark,redis-check-aof,redis-check-rdb,redis-cli,redis-sentinel,redis-server} $redis_install_dir/bin/
+        /bin/cp redis.conf $redis_install_dir/etc/
+        ln -s $redis_install_dir/bin/* /usr/local/bin/
+        sed -i 's@pidfile.*@pidfile /var/run/redis.pid@' $redis_install_dir/etc/redis.conf
+        sed -i "s@logfile.*@logfile $redis_install_dir/var/redis.log@" $redis_install_dir/etc/redis.conf
+        sed -i "s@^dir.*@dir $redis_install_dir/var@" $redis_install_dir/etc/redis.conf
+        sed -i 's@daemonize no@daemonize yes@' $redis_install_dir/etc/redis.conf
+        sed -i "s@^# bind 127.0.0.1@bind 127.0.0.1@" $redis_install_dir/etc/redis.conf
+        redis_maxmemory=`expr $Mem / 8`000000
+        [ -z "`grep ^maxmemory $redis_install_dir/etc/redis.conf`" ] && sed -i "s@maxmemory <bytes>@maxmemory <bytes>\nmaxmemory `expr $Mem / 8`000000@" $redis_install_dir/etc/redis.conf
+        echo "${CSUCCESS}Redis-server installed successfully! ${CEND}"
+        popd
+        rm -rf redis-$redis_version
+        id -u redis >/dev/null 2>&1
+        [ $? -ne 0 ] && useradd -M -s /sbin/nologin redis
+        chown -R redis:redis $redis_install_dir/var
+        /bin/cp ../init.d/Redis-server-init /etc/init.d/redis-server
+        if [ "$OS" == 'CentOS' ];then
+            cc start-stop-daemon.c -o /sbin/start-stop-daemon
+            chkconfig --add redis-server
+            chkconfig redis-server on
+        elif [[ $OS =~ ^Ubuntu$|^Debian$ ]];then
+            update-rc.d redis-server defaults
+        fi
+        sed -i "s@/usr/local/redis@$redis_install_dir@g" /etc/init.d/redis-server
+        #[ -z "`grep 'vm.overcommit_memory' /etc/sysctl.conf`" ] && echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
+        #sysctl -p
+        service redis-server start
+    else
+        rm -rf $redis_install_dir
+        echo "${CFAILURE}Redis-server install failed, Please contact the author! ${CEND}"
+        kill -9 $$
     fi
-    sed -i "s@/usr/local/redis@$redis_install_dir@g" /etc/init.d/redis-server
-    #[ -z "`grep 'vm.overcommit_memory' /etc/sysctl.conf`" ] && echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
-    #sysctl -p
-    service redis-server start
-else
-    rm -rf $redis_install_dir
-    echo "${CFAILURE}Redis-server install failed, Please contact the author! ${CEND}"
-    kill -9 $$
-fi
-cd ..
+    popd
 }
 
 Install_php-redis() {
-cd $oneinstack_dir/src
-if [ -e "$php_install_dir/bin/phpize" ];then
-    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
-        tar xzf redis-${redis_pecl_for_php7_version}.tgz
-        cd redis-${redis_pecl_for_php7_version}
-    else
-        tar xzf redis-$redis_pecl_version.tgz
-        cd redis-$redis_pecl_version
-    fi
-    make clean
-    $php_install_dir/bin/phpize
-    ./configure --with-php-config=$php_install_dir/bin/php-config
-    make -j ${THREAD} && make install
-    if [ -f "`$php_install_dir/bin/php-config --extension-dir`/redis.so" ];then
-        cat > $php_install_dir/etc/php.d/ext-redis.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    if [ -e "$php_install_dir/bin/phpize" ];then
+        if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
+            tar xzf redis-${redis_pecl_for_php7_version}.tgz
+            popd redis-${redis_pecl_for_php7_version}
+        else
+            tar xzf redis-$redis_pecl_version.tgz
+            cd redis-$redis_pecl_version
+        fi
+        make clean
+        $php_install_dir/bin/phpize
+        ./configure --with-php-config=$php_install_dir/bin/php-config
+        make -j ${THREAD} && make install
+        if [ -f "${phpExtensionDir}/redis.so" ];then
+            cat > $php_install_dir/etc/php.d/ext-redis.ini << EOF
 [redis]
 extension=redis.so
 EOF
-        echo "${CSUCCESS}PHP Redis module installed successfully! ${CEND}"
-        cd ..
-        rm -rf redis-$redis_pecl_version
-        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-    else
-        echo "${CFAILURE}PHP Redis module install failed, Please contact the author! ${CEND}"
+            echo "${CSUCCESS}PHP Redis module installed successfully! ${CEND}"
+            popd
+            rm -rf redis-$redis_pecl_version
+            [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+        else
+            echo "${CFAILURE}PHP Redis module install failed, Please contact the author! ${CEND}"
+        fi
     fi
-fi
-cd ..
+    popd
 }

+ 22 - 21
include/xcache.sh

@@ -9,19 +9,20 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_XCache() {
-cd $oneinstack_dir/src
-tar xzf xcache-$xcache_version.tar.gz
-cd xcache-$xcache_version
-make clean
-$php_install_dir/bin/phpize
-./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=$php_install_dir/bin/php-config
-make -j ${THREAD} && make install
-if [ -f "`$php_install_dir/bin/php-config --extension-dir`/xcache.so" ];then
-    /bin/cp -R htdocs $wwwroot_dir/default/xcache
-    chown -R ${run_user}.$run_user $wwwroot_dir/default/xcache
-    touch /tmp/xcache;chown ${run_user}.$run_user /tmp/xcache
-
-    cat > $php_install_dir/etc/php.d/ext-xcache.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    tar xzf xcache-$xcache_version.tar.gz
+    pushd xcache-$xcache_version
+    make clean
+    $php_install_dir/bin/phpize
+    ./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=$php_install_dir/bin/php-config
+    make -j ${THREAD} && make install
+    if [ -f "${phpExtensionDir}/xcache.so" ];then
+        /bin/cp -R htdocs $wwwroot_dir/default/xcache
+        chown -R ${run_user}.$run_user $wwwroot_dir/default/xcache
+        touch /tmp/xcache;chown ${run_user}.$run_user /tmp/xcache
+    
+        cat > $php_install_dir/etc/php.d/ext-xcache.ini << EOF
 [xcache-common]
 extension=xcache.so
 [xcache.admin]
@@ -58,12 +59,12 @@ xcache.coverager = Off
 xcache.coverager_autostart = On
 xcache.coveragedump_directory = ""
 EOF
-    echo "${CSUCCESS}Xcache module installed successfully! ${CEND}"
-    cd ..
-    rm -rf xcache-$xcache_version
-    [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-else
-    echo "${CFAILURE}Xcache module install failed, Please contact the author! ${CEND}"
-fi
-cd ..
+        echo "${CSUCCESS}Xcache module installed successfully! ${CEND}"
+        popd
+        rm -rf xcache-$xcache_version
+        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+    else
+        echo "${CFAILURE}Xcache module install failed, Please contact the author! ${CEND}"
+    fi
+    popd
 }

+ 19 - 18
include/zendopcache.sh

@@ -9,17 +9,18 @@
 #       https://github.com/lj2007331/oneinstack
 
 Install_ZendOPcache() {
-cd $oneinstack_dir/src
-tar xzf zendopcache-$zendopcache_version.tgz
-cd zendopcache-$zendopcache_version
-make clean
-$php_install_dir/bin/phpize
-./configure --with-php-config=$php_install_dir/bin/php-config
-make -j ${THREAD} && make install
-if [ -f "`$php_install_dir/bin/php-config --extension-dir`/opcache.so" ];then
-    cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
+    pushd $oneinstack_dir/src
+    phpExtensionDir=`$php_install_dir/bin/php-config --extension-dir`
+    tar xzf zendopcache-$zendopcache_version.tgz
+    pushd zendopcache-$zendopcache_version
+    make clean
+    $php_install_dir/bin/phpize
+    ./configure --with-php-config=$php_install_dir/bin/php-config
+    make -j ${THREAD} && make install
+    if [ -f "${phpExtensionDir}/opcache.so" ];then
+        cat > $php_install_dir/etc/php.d/ext-opcache.ini << EOF
 [opcache]
-zend_extension=`$php_install_dir/bin/php-config --extension-dir`/opcache.so
+zend_extension=${phpExtensionDir}/opcache.so
 opcache.enable=1
 opcache.memory_consumption=$Memory_limit
 opcache.interned_strings_buffer=8
@@ -30,12 +31,12 @@ opcache.fast_shutdown=1
 opcache.enable_cli=1
 ;opcache.optimization_level=0
 EOF
-    echo "${CSUCCESS}PHP OPcache module installed successfully! ${CEND}"
-    cd ..
-    rm -rf zendopcache-$zendopcache_version
-    [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
-else
-    echo "${CFAILURE}PHP OPcache module install failed, Please contact the author! ${CEND}"
-fi
-cd ..
+        echo "${CSUCCESS}PHP OPcache module installed successfully! ${CEND}"
+        popd
+        rm -rf zendopcache-$zendopcache_version
+        [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
+    else
+        echo "${CFAILURE}PHP OPcache module install failed, Please contact the author! ${CEND}"
+    fi
+    popd
 }

+ 12 - 9
install.sh

@@ -221,7 +221,7 @@ while :; do echo
                 echo -e "\t${CMSG}2${CEND}. Install php-5.4"
                 echo -e "\t${CMSG}3${CEND}. Install php-5.5"
                 echo -e "\t${CMSG}4${CEND}. Install php-5.6"
-                echo -e "\t${CMSG}5${CEND}. Install php-7"
+                echo -e "\t${CMSG}5${CEND}. Install php-7.0"
                 read -p "Please input a number:(Default 3 press Enter) " PHP_version
                 [ -z "$PHP_version" ] && PHP_version=3
                 if [[ ! $PHP_version =~ ^[1-5]$ ]];then
@@ -285,10 +285,11 @@ while :; do echo
                                         echo 'Please select a opcode cache of the PHP:'
                                         echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
                                         echo -e "\t${CMSG}2${CEND}. Install XCache"
+                                        echo -e "\t${CMSG}3${CEND}. Install APCU"
                                         read -p "Please input a number:(Default 1 press Enter) " PHP_cache
                                         [ -z "$PHP_cache" ] && PHP_cache=1
-                                        if [[ ! $PHP_cache =~ ^[1-2]$ ]];then
-                                            echo "${CWARNING}input error! Please only input number 1,2${CEND}"
+                                        if [[ ! $PHP_cache =~ ^[1-3]$ ]];then
+                                            echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
                                         else
                                             break
                                         fi
@@ -298,10 +299,11 @@ while :; do echo
                                     while :; do
                                         echo 'Please select a opcode cache of the PHP:'
                                         echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
+                                        echo -e "\t${CMSG}3${CEND}. Install APCU"
                                         read -p "Please input a number:(Default 1 press Enter) " PHP_cache
                                         [ -z "$PHP_cache" ] && PHP_cache=1
-                                        if [ $PHP_cache != 1 ];then
-                                            echo "${CWARNING}input error! Please only input number 1${CEND}"
+                                        if [[ ! $PHP_cache =~ ^[1,3]$ ]];then
+                                            echo "${CWARNING}input error! Please only input number 1,3${CEND}"
                                         else
                                             break
                                         fi
@@ -317,7 +319,7 @@ while :; do echo
                             (( ${#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
                     fi
-                    if [ "$PHP_version" != '5' -a "$PHP_cache" != '1' ];then
+                    if [ "$PHP_version" != '5' -a "$PHP_cache" != '1' -a "${armPlatform}" != "y" ];then
                         while :; do echo
                             read -p "Do you want to install ZendGuardLoader? [y/n]: " ZendGuardLoader_yn
                             if [[ ! $ZendGuardLoader_yn =~ ^[y,n]$ ]];then
@@ -328,7 +330,8 @@ while :; do echo
                         done
                     fi
 
-                    if [ "$PHP_version" != '5' ];then
+                    # ionCube
+                    if [ "${TARGET_ARCH}" != "arm64" ];then
                         while :; do echo
                             read -p "Do you want to install ionCube? [y/n]: " ionCube_yn
                             if [[ ! $ionCube_yn =~ ^[y,n]$ ]];then
@@ -563,8 +566,8 @@ elif [ "$PHP_version" == '4' ];then
     . include/php-5.6.sh
     Install_PHP-5-6 2>&1 | tee -a $oneinstack_dir/install.log
 elif [ "$PHP_version" == '5' ];then
-    . include/php-7.sh
-    Install_PHP-7 2>&1 | tee -a $oneinstack_dir/install.log
+    . include/php-7.0.sh
+    Install_PHP-7-0 2>&1 | tee -a $oneinstack_dir/install.log
 fi
 
 # ImageMagick or GraphicsMagick

+ 10 - 9
versions.txt

@@ -3,7 +3,7 @@
 nginx_version=1.10.1
 tengine_version=2.1.1
 openresty_version=1.11.2.1
-openssl_version=1.0.2h
+openssl_version=1.0.2j
 
 tomcat_8_version=8.0.30
 tomcat_7_version=7.0.69
@@ -20,13 +20,13 @@ mysql_5_7_version=5.7.15
 mysql_5_6_version=5.6.33
 mysql_5_5_version=5.5.52
 
-mariadb_10_1_version=10.1.17
+mariadb_10_1_version=10.1.18
 mariadb_10_0_version=10.0.27
 mariadb_5_5_version=5.5.52
 
-percona_5_7_version=5.7.14-7
-percona_5_6_version=5.6.32-78.0
-percona_5_5_version=5.5.51-38.1
+percona_5_7_version=5.7.14-8
+percona_5_6_version=5.6.32-78.1
+percona_5_5_version=5.5.52-38.3
 
 # JDK
 jdk_8_version=1.8.0_102
@@ -42,11 +42,12 @@ php_3_version=5.3.29
 
 zendopcache_version=7.0.5
 xcache_version=3.2.0
-apcu_version=4.0.10
-ImageMagick_version=6.9.5-9
+apcu_version=4.0.11
+apcu_for_php7_version=5.1.6
+ImageMagick_version=6.9.6-0
 imagick_version=3.4.1
 imagick_for_php53_version=3.3.0
-GraphicsMagick_version=1.3.24
+GraphicsMagick_version=1.3.25
 gmagick_for_php7_version=2.0.4RC1
 gmagick_version=1.1.7RC3
 libiconv_version=1.14
@@ -60,7 +61,7 @@ eaccelerator_version=0.9.6.1
 pureftpd_version=1.0.43
 
 # Redis
-redis_version=3.2.3
+redis_version=3.2.4
 redis_pecl_for_php7_version=3.0.0
 redis_pecl_version=2.2.8