Selaa lähdekoodia

[feat] Add PHP-8.0

lj2007331@gmail.com 4 vuotta sitten
vanhempi
commit
adce74bee6

+ 4 - 4
include/GraphicsMagick.sh

@@ -34,12 +34,12 @@ Install_pecl_gmagick() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-    if [ "`${php_install_dir}/bin/php-config --version | awk -F. '{print $1}'`" == '7' ]; then
-      tar xzf gmagick-${gmagick_ver}.tgz
-      pushd gmagick-${gmagick_ver} > /dev/null
-    else
+    if [ "`${php_install_dir}/bin/php-config --version | awk -F. '{print $1}'`" == '5' ]; then
       tar xzf gmagick-${gmagick_oldver}.tgz
       pushd gmagick-${gmagick_oldver} > /dev/null
+    else
+      tar xzf gmagick-${gmagick_ver}.tgz
+      pushd gmagick-${gmagick_ver} > /dev/null
     fi
     export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
     ${php_install_dir}/bin/phpize

+ 4 - 4
include/apcu.sh

@@ -12,12 +12,12 @@ Install_APCU() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-    if [ "`${php_install_dir}/bin/php-config --version | awk -F. '{print $1}'`" == '7' ]; then
-      tar xzf apcu-${apcu_ver}.tgz
-      pushd apcu-${apcu_ver} > /dev/null
-    else
+    if [ "`${php_install_dir}/bin/php-config --version | awk -F. '{print $1}'`" == '5' ]; then
       tar xzf apcu-${apcu_oldver}.tgz
       pushd apcu-${apcu_oldver} > /dev/null
+    else
+      tar xzf apcu-${apcu_ver}.tgz
+      pushd apcu-${apcu_ver} > /dev/null
     fi
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config

+ 8 - 2
include/check_download.sh

@@ -17,7 +17,7 @@ checkDownload() {
   fi
 
   # General system utils
-  if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [[ ${apache_option} =~ ^[1-2]$ ]] || [[ ${php_option} =~ ^[1-9]$ ]]; then
+  if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [[ ${apache_option} =~ ^[1-2]$ ]] || [[ ${php_option} =~ ^[1-9]$|^10$ ]]; then
     echo "Download openSSL..."
     src_url=https://www.openssl.org/source/old/1.0.2/openssl-${openssl_ver}.tar.gz && Download_src
     echo "Download cacert.pem..."
@@ -524,7 +524,7 @@ checkDownload() {
   fi
 
   # PHP
-  if [[ "${php_option}" =~ ^[1-9]$ ]]; then
+  if [[ "${php_option}" =~ ^[1-9]$|^10$ ]]; then
     echo "PHP common..."
     src_url=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${libiconv_ver}.tar.gz && Download_src
     src_url=https://curl.haxx.se/download/curl-${curl_ver}.tar.gz && Download_src
@@ -575,6 +575,12 @@ checkDownload() {
       src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
       src_url=http://mirrors.linuxeye.com/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
       ;;
+    10)
+      src_url=https://secure.php.net/distributions/php-${php80_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
+      src_url=http://mirrors.linuxeye.com/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
+      ;;
   esac
 
   # PHP OPCache

+ 8 - 8
include/memcached.sh

@@ -47,13 +47,13 @@ Install_pecl_memcache() {
     phpExtensionDir=$(${php_install_dir}/bin/php-config --extension-dir)
     PHP_detail_ver=$(${php_install_dir}/bin/php-config --version)
     PHP_main_ver=${PHP_detail_ver%.*}
-    if [ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1}')" == '7' ]; then
+    if [ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1}')" == '5' ]; then
+      tar xzf memcache-${pecl_memcache_oldver}.tgz
+      pushd memcache-${pecl_memcache_oldver} > /dev/null
+    else
       #git clone https://github.com/websupport-sk/pecl-memcache.git
       tar xzf memcache-${pecl_memcache_ver}.tgz
       pushd memcache-${pecl_memcache_ver} > /dev/null
-    else
-      tar xzf memcache-${pecl_memcache_oldver}.tgz
-      pushd memcache-${pecl_memcache_oldver} > /dev/null
     fi
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config
@@ -85,12 +85,12 @@ Install_pecl_memcached() {
     popd > /dev/null
     rm -rf libmemcached-${libmemcached_ver}
 
-    if [ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1}')" == '7' ]; then
-      tar xzf memcached-${pecl_memcached_ver}.tgz
-      pushd memcached-${pecl_memcached_ver} > /dev/null
-    else
+    if [ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1}')" == '5' ]; then
       tar xzf memcached-${pecl_memcached_oldver}.tgz
       pushd memcached-${pecl_memcached_oldver} > /dev/null
+    else
+      tar xzf memcached-${pecl_memcached_ver}.tgz
+      pushd memcached-${pecl_memcached_ver} > /dev/null
     fi
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config

+ 4 - 0
include/mphp.sh

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

+ 3 - 3
include/nginx.sh

@@ -28,7 +28,7 @@ Install_Nginx() {
   sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
 
   [ ! -d "${nginx_install_dir}" ] && mkdir -p ${nginx_install_dir}
-  ./configure --prefix=${nginx_install_dir} --user=${run_user} --group=${run_group} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc' ${nginx_modules_options}
+  ./configure --prefix=${nginx_install_dir} --user=${run_user} --group=${run_group} --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc' ${nginx_modules_options}
   make -j ${THREAD} && make install
   if [ -e "${nginx_install_dir}/conf/nginx.conf" ]; then
     popd > /dev/null
@@ -56,11 +56,11 @@ Install_Nginx() {
   mv ${nginx_install_dir}/conf/nginx.conf{,_bk}
   if [[ ${apache_option} =~ ^[1-2]$ ]] || [ -e "${apache_install_dir}/bin/httpd" ]; then
     /bin/cp ../config/nginx_apache.conf ${nginx_install_dir}/conf/nginx.conf
-  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
+  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
     /bin/cp ../config/nginx_tomcat.conf ${nginx_install_dir}/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${nginx_install_dir}/conf/nginx.conf
-    [[ "${php_option}" =~ ^[1-9]$ ]] && [ -z "`grep '/php-fpm_status' ${nginx_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${nginx_install_dir}/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-9]$|^10$ ]] && [ -z "`grep '/php-fpm_status' ${nginx_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${nginx_install_dir}/conf/nginx.conf
   fi
   cat > ${nginx_install_dir}/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 3 - 3
include/openresty.sh

@@ -24,7 +24,7 @@ Install_OpenResty() {
   sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' bundle/nginx-${openresty_ver%.*}/auto/cc/gcc # close debug
 
   [ ! -d "${openresty_install_dir}" ] && mkdir -p ${openresty_install_dir}
-  ./configure --prefix=${openresty_install_dir} --user=${run_user} --group=${run_group} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc -Wl,-u,pcre_version' ${nginx_modules_options}
+  ./configure --prefix=${openresty_install_dir} --user=${run_user} --group=${run_group} --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc -Wl,-u,pcre_version' ${nginx_modules_options}
   make -j ${THREAD} && make install
   if [ -e "${openresty_install_dir}/nginx/conf/nginx.conf" ]; then
     popd > /dev/null
@@ -52,11 +52,11 @@ Install_OpenResty() {
   mv ${openresty_install_dir}/nginx/conf/nginx.conf{,_bk}
   if [[ ${apache_option} =~ ^[1-2]$ ]] || [ -e "${apache_install_dir}/bin/httpd" ]; then
     /bin/cp ../config/nginx_apache.conf ${openresty_install_dir}/nginx/conf/nginx.conf 
-  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
+  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
     /bin/cp ../config/nginx_tomcat.conf ${openresty_install_dir}/nginx/conf/nginx.conf 
   else
     /bin/cp ../config/nginx.conf ${openresty_install_dir}/nginx/conf/nginx.conf
-    [[ "${php_option}" =~ ^[1-9]$ ]] && [ -z "`grep '/php-fpm_status' ${openresty_install_dir}/nginx/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${openresty_install_dir}/nginx/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-9]$|^10$ ]] && [ -z "`grep '/php-fpm_status' ${openresty_install_dir}/nginx/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${openresty_install_dir}/nginx/conf/nginx.conf
   fi
   cat > ${openresty_install_dir}/nginx/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 288 - 0
include/php-8.0.sh

@@ -0,0 +1,288 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://linuxeye.com
+#
+# Notes: OneinStack for CentOS/RedHat 6+ Debian 8+ and Ubuntu 14+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/oneinstack/oneinstack
+
+Install_PHP80() {
+  pushd ${oneinstack_dir}/src > /dev/null
+  if [ -e "${apache_install_dir}/bin/httpd" ];then
+    [ "$(${apache_install_dir}/bin/httpd -v | awk -F'.' /version/'{print $2}')" == '4' ] && Apache_main_ver=24
+    [ "$(${apache_install_dir}/bin/httpd -v | awk -F'.' /version/'{print $2}')" == '2' ] && Apache_main_ver=22
+  fi
+  if [ ! -e "${libiconv_install_dir}/lib/libiconv.la" ]; then
+    tar xzf libiconv-${libiconv_ver}.tar.gz
+    pushd libiconv-${libiconv_ver} > /dev/null
+    ./configure --prefix=${libiconv_install_dir}
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf libiconv-${libiconv_ver}
+  fi
+
+  if [ ! -e "${curl_install_dir}/lib/libcurl.la" ]; then
+    tar xzf curl-${curl_ver}.tar.gz
+    pushd curl-${curl_ver} > /dev/null
+    [ "${Debian_ver}" == '8' ] && apt-get -y remove zlib1g-dev
+    ./configure --prefix=${curl_install_dir} --with-ssl=${openssl_install_dir}
+    make -j ${THREAD} && make install
+    [ "${Debian_ver}" == '8' ] && apt-get -y install libc-client2007e-dev libglib2.0-dev libpng12-dev libssl-dev libzip-dev zlib1g-dev
+    popd > /dev/null
+    rm -rf curl-${curl_ver}
+  fi
+
+  if [ ! -e "${freetype_install_dir}/lib/libfreetype.la" ]; then
+    tar xzf freetype-${freetype_ver}.tar.gz
+    pushd freetype-${freetype_ver} > /dev/null
+    ./configure --prefix=${freetype_install_dir} --enable-freetype-config
+    make -j ${THREAD} && make install
+    ln -sf ${freetype_install_dir}/include/freetype2/* /usr/include/
+    [ -d /usr/lib/pkgconfig ] && /bin/cp ${freetype_install_dir}/lib/pkgconfig/freetype2.pc /usr/lib/pkgconfig/
+    popd > /dev/null
+    rm -rf freetype-${freetype_ver}
+  fi
+
+  if [ ! -e "/usr/lib/libargon2.a" ]; then
+    tar xzf argon2-${argon2_ver}.tar.gz
+    pushd argon2-${argon2_ver} > /dev/null
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf argon2-${argon2_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libsodium.la" ]; then
+    tar xzf libsodium-${libsodium_ver}.tar.gz
+    pushd libsodium-${libsodium_ver} > /dev/null
+    ./configure --disable-dependency-tracking --enable-minimal
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf libsodium-${libsodium_ver}
+  fi
+
+  if [ ! -e "/usr/local/lib/libzip.la" ]; then
+    tar xzf libzip-${libzip_ver}.tar.gz
+    pushd libzip-${libzip_ver} > /dev/null
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf libzip-${libzip_ver}
+  fi
+
+  if [ ! -e "/usr/local/include/mhash.h" -a ! -e "/usr/include/mhash.h" ]; then
+    tar xzf mhash-${mhash_ver}.tar.gz
+    pushd mhash-${mhash_ver} > /dev/null
+    ./configure
+    make -j ${THREAD} && make install
+    popd > /dev/null
+    rm -rf mhash-${mhash_ver}
+  fi
+
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  ldconfig
+
+  if [ "${PM}" == 'yum' ]; then
+    if [ "${OS_BIT}" == '64' ]; then
+      [ ! -e "/lib64/libpcre.so.1" ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
+      [ ! -e "/usr/lib/libc-client.so" ] && ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
+    else
+      [ ! -e "/lib/libpcre.so.1" ] && ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
+    fi
+  fi
+
+  id -g ${run_group} >/dev/null 2>&1
+  [ $? -ne 0 ] && groupadd ${run_group}
+  id -u ${run_user} >/dev/null 2>&1
+  [ $? -ne 0 ] && useradd -g ${run_group} -M -s /sbin/nologin ${run_user}
+
+  tar xzf php-${php80_ver}.tar.gz
+  pushd php-${php80_ver} > /dev/null
+  make clean
+  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:$PKG_CONFIG_PATH
+  [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
+  [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
+    ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
+    --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
+    --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
+    --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
+    --with-iconv-dir=${libiconv_install_dir} --with-freetype --with-jpeg --with-zlib \
+    --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
+    --enable-mbstring --with-password-argon2 --with-sodium=/usr/local --enable-gd --with-openssl=${openssl_install_dir} \
+    --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
+    --with-gettext --with-zip=/usr/local --enable-soap --disable-debug ${php_modules_options}
+  else
+    ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
+    --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
+    --with-fpm-user=${run_user} --with-fpm-group=${run_group} --enable-fpm ${phpcache_arg} --disable-fileinfo \
+    --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
+    --with-iconv-dir=${libiconv_install_dir} --with-freetype --with-jpeg --with-zlib \
+    --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
+    --enable-sysvsem --enable-inline-optimization --with-curl=${curl_install_dir} --enable-mbregex \
+    --enable-mbstring --with-password-argon2 --with-sodium=/usr/local --enable-gd --with-openssl=${openssl_install_dir} \
+    --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-ftp --enable-intl --with-xsl \
+    --with-gettext --with-zip=/usr/local --enable-soap --disable-debug ${php_modules_options}
+  fi
+  make ZEND_EXTRA_LIBS='-liconv' -j ${THREAD}
+  make install
+
+  if [ -e "${php_install_dir}/bin/phpize" ]; then
+    echo "${CSUCCESS}PHP installed successfully! ${CEND}"
+  else
+    rm -rf ${php_install_dir}
+    echo "${CFAILURE}PHP install failed, Please Contact the author! ${CEND}"
+    kill -9 $$
+  fi
+
+  [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${php_install_dir}/bin:\$PATH" >> /etc/profile
+  [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${php_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${php_install_dir}/bin:\1@" /etc/profile
+  . /etc/profile
+
+  # wget -c http://pear.php.net/go-pear.phar
+  # ${php_install_dir}/bin/php go-pear.phar
+
+  [ ! -e "${php_install_dir}/etc/php.d" ] && mkdir -p ${php_install_dir}/etc/php.d
+  /bin/cp php.ini-production ${php_install_dir}/etc/php.ini
+
+  sed -i "s@^memory_limit.*@memory_limit = ${Memory_limit}M@" ${php_install_dir}/etc/php.ini
+  sed -i 's@^output_buffering =@output_buffering = On\noutput_buffering =@' ${php_install_dir}/etc/php.ini
+  #sed -i 's@^;cgi.fix_pathinfo.*@cgi.fix_pathinfo=0@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^short_open_tag = Off@short_open_tag = On@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^expose_php = On@expose_php = Off@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^request_order.*@request_order = "CGP"@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^;date.timezone.*@date.timezone = ${timezone}@" ${php_install_dir}/etc/php.ini
+  sed -i 's@^post_max_size.*@post_max_size = 100M@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^upload_max_filesize.*@upload_max_filesize = 50M@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^max_execution_time.*@max_execution_time = 600@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^;realpath_cache_size.*@realpath_cache_size = 2M@' ${php_install_dir}/etc/php.ini
+  sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
+  [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
+  sed -i "s@^;curl.cainfo.*@curl.cainfo = \"${openssl_install_dir}/cert.pem\"@" ${php_install_dir}/etc/php.ini
+  sed -i "s@^;openssl.cafile.*@openssl.cafile = \"${openssl_install_dir}/cert.pem\"@" ${php_install_dir}/etc/php.ini
+  sed -i "s@^;openssl.capath.*@openssl.capath = \"${openssl_install_dir}/cert.pem\"@" ${php_install_dir}/etc/php.ini
+
+  [ "${phpcache_option}" == '1' ] && cat > ${php_install_dir}/etc/php.d/02-opcache.ini << EOF
+[opcache]
+zend_extension=opcache.so
+opcache.enable=1
+opcache.enable_cli=1
+opcache.memory_consumption=${Memory_limit}
+opcache.interned_strings_buffer=8
+opcache.max_accelerated_files=100000
+opcache.max_wasted_percentage=5
+opcache.use_cwd=1
+opcache.validate_timestamps=1
+opcache.revalidate_freq=60
+;opcache.save_comments=0
+opcache.consistency_checks=0
+;opcache.optimization_level=0
+EOF
+
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
+    # php-fpm Init Script
+    if [ -e /bin/systemctl ]; then
+      /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
+      sed -i "s@/usr/local/php@${php_install_dir}@g" /lib/systemd/system/php-fpm.service
+      systemctl enable php-fpm
+    else
+      /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
+      chmod +x /etc/init.d/php-fpm
+      [ "${PM}" == 'yum' ] && { chkconfig --add php-fpm; chkconfig php-fpm on; }
+      [ "${PM}" == 'apt-get' ] && update-rc.d php-fpm defaults
+    fi
+
+    cat > ${php_install_dir}/etc/php-fpm.conf <<EOF
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+pid = run/php-fpm.pid
+error_log = log/php-fpm.log
+log_level = warning
+
+emergency_restart_threshold = 30
+emergency_restart_interval = 60s
+process_control_timeout = 5s
+daemonize = yes
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ;
+;;;;;;;;;;;;;;;;;;;;
+
+[${run_user}]
+listen = /dev/shm/php-cgi.sock
+listen.backlog = -1
+listen.allowed_clients = 127.0.0.1
+listen.owner = ${run_user}
+listen.group = ${run_group}
+listen.mode = 0666
+user = ${run_user}
+group = ${run_group}
+
+pm = dynamic
+pm.max_children = 12
+pm.start_servers = 8
+pm.min_spare_servers = 6
+pm.max_spare_servers = 12
+pm.max_requests = 2048
+pm.process_idle_timeout = 10s
+request_terminate_timeout = 120
+request_slowlog_timeout = 0
+
+pm.status_path = /php-fpm_status
+slowlog = var/log/slow.log
+rlimit_files = 51200
+rlimit_core = 0
+
+catch_workers_output = yes
+;env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
+EOF
+
+    if [ $Mem -le 3000 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = $(($Mem/3/20))@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = $(($Mem/3/30))@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = $(($Mem/3/40))@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = $(($Mem/3/20))@" ${php_install_dir}/etc/php-fpm.conf
+    elif [ $Mem -gt 3000 -a $Mem -le 4500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 50@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 30@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 20@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 50@" ${php_install_dir}/etc/php-fpm.conf
+    elif [ $Mem -gt 4500 -a $Mem -le 6500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 60@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 40@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 30@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 60@" ${php_install_dir}/etc/php-fpm.conf
+    elif [ $Mem -gt 6500 -a $Mem -le 8500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 70@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 50@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 40@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 70@" ${php_install_dir}/etc/php-fpm.conf
+    elif [ $Mem -gt 8500 ]; then
+      sed -i "s@^pm.max_children.*@pm.max_children = 80@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.start_servers.*@pm.start_servers = 60@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.min_spare_servers.*@pm.min_spare_servers = 50@" ${php_install_dir}/etc/php-fpm.conf
+      sed -i "s@^pm.max_spare_servers.*@pm.max_spare_servers = 80@" ${php_install_dir}/etc/php-fpm.conf
+    fi
+
+    service php-fpm start
+
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
+    service httpd restart
+  fi
+  popd > /dev/null
+  [ -e "${php_install_dir}/bin/phpize" ] && rm -rf php-${php80_ver}
+  popd > /dev/null
+}

+ 4 - 4
include/redis.sh

@@ -61,12 +61,12 @@ Install_pecl_redis() {
   if [ -e "${php_install_dir}/bin/phpize" ]; then
     pushd ${oneinstack_dir}/src > /dev/null
     phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
-    if [ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1}')" == '7' ]; then
-      tar xzf redis-${pecl_redis_ver}.tgz
-      pushd redis-${pecl_redis_ver} > /dev/null
-    else
+    if [ "$(${php_install_dir}/bin/php-config --version | awk -F. '{print $1}')" == '5' ]; then
       tar xzf redis-${pecl_redis_oldver}.tgz
       pushd redis-${pecl_redis_oldver} > /dev/null
+    else
+      tar xzf redis-${pecl_redis_ver}.tgz
+      pushd redis-${pecl_redis_ver} > /dev/null
     fi
     ${php_install_dir}/bin/phpize
     ./configure --with-php-config=${php_install_dir}/bin/php-config

+ 2 - 2
include/tengine.sh

@@ -51,11 +51,11 @@ Install_Tengine() {
   mv ${tengine_install_dir}/conf/nginx.conf{,_bk}
   if [[ ${apache_option} =~ ^[1-2]$ ]] || [ -e "${apache_install_dir}/bin/httpd" ]; then
     /bin/cp ../config/nginx_apache.conf ${tengine_install_dir}/conf/nginx.conf
-  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
+  elif { [[ ${tomcat_option} =~ ^[1-4]$ ]] || [ -e "${tomcat_install_dir}/conf/server.xml" ]; } && { [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && [ ! -e "${php_install_dir}/bin/php" ]; }; then
     /bin/cp ../config/nginx_tomcat.conf ${tengine_install_dir}/conf/nginx.conf
   else
     /bin/cp ../config/nginx.conf ${tengine_install_dir}/conf/nginx.conf
-    [[ "${php_option}" =~ ^[1-9]$ ]] && [ -z "`grep '/php-fpm_status' ${tengine_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${tengine_install_dir}/conf/nginx.conf
+    [[ "${php_option}" =~ ^[1-9]$|^10$ ]] && [ -z "`grep '/php-fpm_status' ${tengine_install_dir}/conf/nginx.conf`" ] &&  sed -i "s@index index.html index.php;@index index.html index.php;\n    location ~ /php-fpm_status {\n        #fastcgi_pass remote_php_ip:9000;\n        fastcgi_pass unix:/dev/shm/php-cgi.sock;\n        fastcgi_index index.php;\n        include fastcgi.conf;\n        allow 127.0.0.1;\n        deny all;\n        }@" ${tengine_install_dir}/conf/nginx.conf
   fi
   cat > ${tengine_install_dir}/conf/proxy.conf << EOF
 proxy_connect_timeout 300s;

+ 1 - 1
include/upgrade_web.sh

@@ -177,7 +177,7 @@ Upgrade_OpenResty() {
     make clean
     sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' bundle/nginx-${NEW_openresy_ver%.*}/auto/cc/gcc # close debug
     ${openresty_install_dir}/nginx/sbin/nginx -V &> $$
-    ./configure --prefix=${openresty_install_dir} --user=${run_user} --group=${run_user} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc -Wl,-u,pcre_version' ${nginx_modules_options}
+    ./configure --prefix=${openresty_install_dir} --user=${run_user} --group=${run_user} --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl11_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc -Wl,-u,pcre_version' ${nginx_modules_options}
     make -j ${THREAD}
     if [ -f "build/nginx-${NEW_openresy_ver%.*}/objs/nginx" ]; then
       /bin/mv ${openresty_install_dir}/nginx/sbin/nginx{,`date +%m%d`}

+ 25 - 20
install.sh

@@ -49,8 +49,8 @@ Show_Help() {
   --apache_option [1-2]       Install Apache server version
   --apache_mode_option [1-2]  Apache2.4 mode, 1(default): php-fpm, 2: mod_php
   --apache_mpm_option [1-3]   Apache2.4 MPM, 1(default): event, 2: prefork, 3: worker
-  --php_option [1-9]          Install PHP version
-  --mphp_ver [53~74]          Install another PHP version (PATH: ${php_install_dir}\${mphp_ver})
+  --php_option [1-10]         Install PHP version
+  --mphp_ver [53~80]          Install another PHP version (PATH: ${php_install_dir}\${mphp_ver})
   --mphp_addons               Only install another PHP addons
   --phpcache_option [1-4]     Install PHP opcode cache, default: 1 opcache
   --php_extensions [ext name] Install PHP extensions, include zendguardloader,ioncube,
@@ -107,12 +107,12 @@ while :; do
       ;;
     --php_option)
       php_option=$2; shift 2
-      [[ ! ${php_option} =~ ^[1-9]$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~9${CEND}"; exit 1; }
+      [[ ! ${php_option} =~ ^[1-9]$|^10$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~10${CEND}"; exit 1; }
       [ -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP already installed! ${CEND}"; unset php_option; }
       ;;
     --mphp_ver)
       mphp_ver=$2; mphp_flag=y; shift 2
-      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~74${CEND}"; exit 1; }
+      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~80${CEND}"; exit 1; }
       ;;
     --mphp_addons)
       mphp_addons_flag=y; shift 1
@@ -487,19 +487,20 @@ if [ ${ARG_NUM} == 0 ]; then
         [ -e "${php_install_dir}/bin/phpize" ] && { echo "${CWARNING}PHP already installed! ${CEND}"; unset php_option; break; }
         while :; do echo
           echo 'Please select a version of the PHP:'
-          echo -e "\t${CMSG}1${CEND}. Install php-5.3"
-          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.0"
-          echo -e "\t${CMSG}6${CEND}. Install php-7.1"
-          echo -e "\t${CMSG}7${CEND}. Install php-7.2"
-          echo -e "\t${CMSG}8${CEND}. Install php-7.3"
-          echo -e "\t${CMSG}9${CEND}. Install php-7.4"
+          echo -e "\t${CMSG} 1${CEND}. Install php-5.3"
+          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.0"
+          echo -e "\t${CMSG} 6${CEND}. Install php-7.1"
+          echo -e "\t${CMSG} 7${CEND}. Install php-7.2"
+          echo -e "\t${CMSG} 8${CEND}. Install php-7.3"
+          echo -e "\t${CMSG} 9${CEND}. Install php-7.4"
+          echo -e "\t${CMSG}10${CEND}. Install php-8.0"
           read -e -p "Please input a number:(Default 7 press Enter) " php_option
           php_option=${php_option:-7}
-          if [[ ! ${php_option} =~ ^[1-9]$ ]]; then
-            echo "${CWARNING}input error! Please only input number 1~9${CEND}"
+          if [[ ! ${php_option} =~ ^[1-9]$|^10$ ]]; then
+            echo "${CWARNING}input error! Please only input number 1~10${CEND}"
           else
             break
           fi
@@ -516,7 +517,7 @@ if [ ${ARG_NUM} == 0 ]; then
   fi
 
   # PHP opcode cache and extensions
-  if [[ ${php_option} =~ ^[1-9]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
+  if [[ ${php_option} =~ ^[1-9]$|^10$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
       read -e -p "Do you want to install opcode cache of the PHP? [y/n]: " phpcache_flag
       if [[ ! ${phpcache_flag} =~ ^[y,n]$ ]]; then
@@ -585,7 +586,7 @@ if [ ${ARG_NUM} == 0 ]; then
               fi
             done
           fi
-          if [[ ${php_option} =~ ^[5-9]$ ]] || [[ "${PHP_main_ver}" =~ ^7.[0-4]$ ]]; then
+          if [[ ${php_option} =~ ^[5-9]$|^10$ ]] || [[ "${PHP_main_ver}" =~ ^7.[0-4]$|^8.0$ ]]; then
             while :; do
               echo 'Please select a opcode cache of the PHP:'
               echo -e "\t${CMSG}1${CEND}. Install Zend OPcache"
@@ -678,7 +679,7 @@ if [ ${ARG_NUM} == 0 ]; then
   done
 
   # check phpMyAdmin
-  if [[ ${php_option} =~ ^[1-9]$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
+  if [[ ${php_option} =~ ^[1-9]$|^10$ ]] || [ -e "${php_install_dir}/bin/phpize" ]; then
     while :; do echo
       read -e -p "Do you want to install phpMyAdmin? [y/n]: " phpmyadmin_flag
       if [[ ! ${phpmyadmin_flag} =~ ^[y,n]$ ]]; then
@@ -796,7 +797,7 @@ if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-3]$ ]];
 fi
 
 # openSSL
-if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [[ ${apache_option} =~ ^[1-2]$ ]] || [[ ${php_option} =~ ^[1-9]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$ ]]; then
+if [[ ${tomcat_option} =~ ^[1-4]$ ]] || [[ ${apache_option} =~ ^[1-2]$ ]] || [[ ${php_option} =~ ^[1-9]$|^10$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]]; then
   . include/openssl.sh
   Install_openSSL | tee -a ${oneinstack_dir}/install.log
 fi
@@ -931,6 +932,10 @@ case "${php_option}" in
     . include/php-7.4.sh
     Install_PHP74 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
+  10)
+    . include/php-8.0.sh
+    Install_PHP80 2>&1 | tee -a ${oneinstack_dir}/install.log
+    ;;
 esac
 
 PHP_addons() {
@@ -1192,7 +1197,7 @@ echo "Total OneinStack Install Time: ${CQUESTION}${installTime}${CEND} minutes"
 [ "${db_option}" == '15' ] && echo "$(printf "%-32s" "MongoDB data dir:")${CMSG}${mongo_data_dir}${CEND}"
 [ "${db_option}" == '15' ] && echo "$(printf "%-32s" "MongoDB user:")${CMSG}root${CEND}"
 [ "${db_option}" == '15' ] && echo "$(printf "%-32s" "MongoDB password:")${CMSG}${dbmongopwd}${CEND}"
-[[ "${php_option}" =~ ^[1-9]$ ]] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
+[[ "${php_option}" =~ ^[1-9]$|^10$ ]] && echo -e "\n$(printf "%-32s" "PHP install dir:")${CMSG}${php_install_dir}${CEND}"
 [ "${phpcache_option}" == '1' ] && echo "$(printf "%-32s" "Opcache Control Panel URL:")${CMSG}http://${IPADDR}/ocp.php${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache Control Panel URL:")${CMSG}http://${IPADDR}/xcache${CEND}"
 [ "${phpcache_option}" == '2' -a -e "${php_install_dir}/etc/php.d/04-xcache.ini" ] && echo "$(printf "%-32s" "xcache user:")${CMSG}admin${CEND}"

+ 4 - 4
uninstall.sh

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

+ 15 - 14
versions.txt

@@ -2,7 +2,7 @@
 # Web
 nginx_ver=1.18.0
 tengine_ver=2.3.2
-openresty_ver=1.17.8.2
+openresty_ver=1.19.3.1
 openssl11_ver=1.1.1h
 openssl_ver=1.0.2u
 
@@ -16,7 +16,7 @@ apache22_ver=2.2.34
 pcre_ver=8.44
 apr_ver=1.7.0
 apr_util_ver=1.6.1
-nghttp2_ver=1.41.0
+nghttp2_ver=1.42.0
 
 # DB
 mysql80_ver=8.0.22
@@ -24,25 +24,25 @@ mysql57_ver=5.7.32
 mysql56_ver=5.6.50
 mysql55_ver=5.5.62
 
-mariadb105_ver=10.5.6
-mariadb104_ver=10.4.15
-mariadb103_ver=10.3.25
+mariadb105_ver=10.5.8
+mariadb104_ver=10.4.17
+mariadb103_ver=10.3.27
 mariadb55_ver=5.5.68
 
 percona80_ver=8.0.21-12
-percona57_ver=5.7.31-34
-percona56_ver=5.6.49-89.0
+percona57_ver=5.7.32-35
+percona56_ver=5.6.50-90.0
 percona55_ver=5.5.62-38.14
 
 alisql_ver=5.6.32-9
 
-pgsql_ver=12.4
+pgsql_ver=12.5
 
 mongodb_ver=4.0.16
 
 # JDK
-jdk110_ver=11.0.8
-jdk18_ver=1.8.0_261
+jdk110_ver=11.0.9
+jdk18_ver=1.8.0_271
 jdk17_ver=1.7.0_80
 jdk16_ver=1.6.0_45
 
@@ -54,8 +54,9 @@ php56_ver=5.6.40
 php70_ver=7.0.33
 php71_ver=7.1.33
 php72_ver=7.2.34
-php73_ver=7.3.24
-php74_ver=7.4.12
+php73_ver=7.3.25
+php74_ver=7.4.13
+php80_ver=8.0.0
 
 libiconv_ver=1.16
 curl_ver=7.73.0
@@ -67,7 +68,7 @@ icu4c_ver=63_1
 libsodium_ver=1.0.18
 libzip_ver=1.2.0
 argon2_ver=20171227
-imagemagick_ver=7.0.10-35
+imagemagick_ver=7.0.10-43
 imagick_ver=3.4.4
 graphicsmagick_ver=1.3.35
 gmagick_ver=2.0.5RC1
@@ -104,7 +105,7 @@ pecl_memcache_ver=4.0.5.2
 pecl_memcache_oldver=3.0.8
 
 # MongoDB
-pecl_mongodb_ver=1.8.1
+pecl_mongodb_ver=1.8.2
 pecl_mongo_ver=1.6.16
 
 # phpMyadmin

+ 27 - 25
vhost.sh

@@ -33,7 +33,7 @@ Show_Help() {
   --help, -h                  Show this help message
   --quiet, -q                 quiet operation
   --list, -l                  List Virtualhost
-  --mphp_ver [53~74]          Use another PHP version (PATH: /usr/local/php${mphp_ver})
+  --mphp_ver [53~80]          Use another PHP version (PATH: /usr/local/php${mphp_ver})
   --proxy                     Use proxy
   --add                       Add Virtualhost
   --delete, --del             Delete Virtualhost
@@ -62,7 +62,7 @@ while :; do
       ;;
     --mphp_ver)
       mphp_ver=$2; mphp_flag=y; shift 2
-      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~74${CEND}"; unset mphp_ver mphp_flag; }
+      [[ ! "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^80$ ]] && { echo "${CWARNING}mphp_ver input error! Please only input number 53~80${CEND}"; unset mphp_ver mphp_flag; }
       ;;
     --proxy)
       proxy_flag=y; shift 1
@@ -364,34 +364,36 @@ What Are You Doing?
       PHP_main_ver=${PHP_detail_ver%.*}
       while :; do echo
         echo 'Please select a version of the PHP:'
-        echo -e "\t${CMSG} 1${CEND}. PHP ${PHP_main_ver} (default)"
-        [ -e "/dev/shm/php53-cgi.sock" ] && echo -e "\t${CMSG} 2${CEND}. PHP 5.3"
-        [ -e "/dev/shm/php54-cgi.sock" ] && echo -e "\t${CMSG} 3${CEND}. PHP 5.4"
-        [ -e "/dev/shm/php55-cgi.sock" ] && echo -e "\t${CMSG} 4${CEND}. PHP 5.5"
-        [ -e "/dev/shm/php56-cgi.sock" ] && echo -e "\t${CMSG} 5${CEND}. PHP 5.6"
-        [ -e "/dev/shm/php70-cgi.sock" ] && echo -e "\t${CMSG} 6${CEND}. PHP 7.0"
-        [ -e "/dev/shm/php71-cgi.sock" ] && echo -e "\t${CMSG} 7${CEND}. PHP 7.1"
-        [ -e "/dev/shm/php72-cgi.sock" ] && echo -e "\t${CMSG} 8${CEND}. PHP 7.2"
-        [ -e "/dev/shm/php73-cgi.sock" ] && echo -e "\t${CMSG} 9${CEND}. PHP 7.3"
-        [ -e "/dev/shm/php74-cgi.sock" ] && echo -e "\t${CMSG}10${CEND}. PHP 7.4"
-        read -e -p "Please input a number:(Default 1 press Enter) " php_option
-        php_option=${php_option:-1}
-        if [[ ! ${php_option} =~ ^[1-9]$|^10$ ]]; then
-          echo "${CWARNING}input error! Please only input number 1~10${CEND}"
+        echo -e "\t${CMSG} 0${CEND}. PHP ${PHP_main_ver} (default)"
+        [ -e "/dev/shm/php53-cgi.sock" ] && echo -e "\t${CMSG} 1${CEND}. PHP 5.3"
+        [ -e "/dev/shm/php54-cgi.sock" ] && echo -e "\t${CMSG} 2${CEND}. PHP 5.4"
+        [ -e "/dev/shm/php55-cgi.sock" ] && echo -e "\t${CMSG} 3${CEND}. PHP 5.5"
+        [ -e "/dev/shm/php56-cgi.sock" ] && echo -e "\t${CMSG} 4${CEND}. PHP 5.6"
+        [ -e "/dev/shm/php70-cgi.sock" ] && echo -e "\t${CMSG} 5${CEND}. PHP 7.0"
+        [ -e "/dev/shm/php71-cgi.sock" ] && echo -e "\t${CMSG} 6${CEND}. PHP 7.1"
+        [ -e "/dev/shm/php72-cgi.sock" ] && echo -e "\t${CMSG} 7${CEND}. PHP 7.2"
+        [ -e "/dev/shm/php73-cgi.sock" ] && echo -e "\t${CMSG} 8${CEND}. PHP 7.3"
+        [ -e "/dev/shm/php74-cgi.sock" ] && echo -e "\t${CMSG} 9${CEND}. PHP 7.4"
+        [ -e "/dev/shm/php80-cgi.sock" ] && echo -e "\t${CMSG}10${CEND}. PHP 8.0"
+        read -e -p "Please input a number:(Default 0 press Enter) " php_option
+        php_option=${php_option:-0}
+        if [[ ! ${php_option} =~ ^[0-9]$|^10$ ]]; then
+          echo "${CWARNING}input error! Please only input number 0~10${CEND}"
         else
           break
         fi
       done
     fi
-    [ "${php_option}" == '2' ] && mphp_ver=53
-    [ "${php_option}" == '3' ] && mphp_ver=54
-    [ "${php_option}" == '4' ] && mphp_ver=55
-    [ "${php_option}" == '5' ] && mphp_ver=56
-    [ "${php_option}" == '6' ] && mphp_ver=70
-    [ "${php_option}" == '7' ] && mphp_ver=71
-    [ "${php_option}" == '8' ] && mphp_ver=72
-    [ "${php_option}" == '9' ] && mphp_ver=73
-    [ "${php_option}" == '10' ] && mphp_ver=74
+    [ "${php_option}" == '1' ] && mphp_ver=53
+    [ "${php_option}" == '2' ] && mphp_ver=54
+    [ "${php_option}" == '3' ] && mphp_ver=55
+    [ "${php_option}" == '4' ] && mphp_ver=56
+    [ "${php_option}" == '5' ] && mphp_ver=70
+    [ "${php_option}" == '6' ] && mphp_ver=71
+    [ "${php_option}" == '7' ] && mphp_ver=72
+    [ "${php_option}" == '8' ] && mphp_ver=73
+    [ "${php_option}" == '9' ] && mphp_ver=74
+    [ "${php_option}" == '10' ] && mphp_ver=80
     [ ! -e "/dev/shm/php${mphp_ver}-cgi.sock" ] && unset mphp_ver
   fi