From 9ab31feb99ea697f178a31ba759dc192a7e0b7f5 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 16 Jul 2022 12:50:33 +0800 Subject: [PATCH] up --- plugins/php/versions/52/install.sh | 3 +- plugins/php/versions/53/install.sh | 3 +- plugins/php/versions/54/install.sh | 3 +- plugins/php/versions/55/install.sh | 3 +- plugins/php/versions/56/install.sh | 3 +- plugins/php/versions/70/install.sh | 3 +- plugins/php/versions/71/install.sh | 3 +- plugins/php/versions/72/install.sh | 3 +- plugins/php/versions/73/install.sh | 5 +- plugins/php/versions/74/install.sh | 5 +- plugins/php/versions/80/install.sh | 5 +- plugins/php/versions/81/install.sh | 7 +- plugins/php/versions/82/install.sh | 4 +- plugins/php/versions/common/gd.sh | 1 + plugins/php/versions/common/iconv.sh | 107 +++++++++++++++++++++++++++ plugins/php/versions/phplib.conf | 5 -- 16 files changed, 138 insertions(+), 25 deletions(-) create mode 100755 plugins/php/versions/common/iconv.sh diff --git a/plugins/php/versions/52/install.sh b/plugins/php/versions/52/install.sh index f202839db..cc9a2cdde 100755 --- a/plugins/php/versions/52/install.sh +++ b/plugins/php/versions/52/install.sh @@ -115,7 +115,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index a45fe8477..a6cbe285b 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -47,7 +47,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/54/install.sh b/plugins/php/versions/54/install.sh index f3735b430..bc144e46f 100755 --- a/plugins/php/versions/54/install.sh +++ b/plugins/php/versions/54/install.sh @@ -39,7 +39,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh index 7594d38be..2d536aed2 100755 --- a/plugins/php/versions/55/install.sh +++ b/plugins/php/versions/55/install.sh @@ -38,7 +38,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/56/install.sh b/plugins/php/versions/56/install.sh index a0a262fe1..fdd619ff0 100755 --- a/plugins/php/versions/56/install.sh +++ b/plugins/php/versions/56/install.sh @@ -38,7 +38,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index b7f134955..809e01e73 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -38,7 +38,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index 32d3fc814..1c59fa63f 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -37,7 +37,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index 4ed39b4e0..1b39c63ab 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -38,7 +38,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index f94bb550c..d109ae6b2 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -23,7 +23,7 @@ mkdir -p $serverPath/php cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash freetype_old.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libiconv.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh -cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh +# cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh if [ ! -d $sourcePath/php/php${PHP_VER} ];then @@ -42,7 +42,8 @@ if [ $sysName == 'Darwin' ]; then # OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip" # OPTIONS="${OPTIONS} --enable-zip" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip" fi diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 98366eb6f..630bf022b 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -23,7 +23,7 @@ mkdir -p $serverPath/php cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash freetype_new.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libiconv.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh -cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh +# cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh if [ ! -d $sourcePath/php/php${PHP_VER} ];then @@ -50,7 +50,8 @@ if [ $sysName == 'Darwin' ]; then export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig" export LDFLAGS="-L/usr/local/opt/libxml2/lib" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index 6fd4c02e2..f8c9d8157 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -23,7 +23,7 @@ mkdir -p $serverPath/php cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash freetype_new.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libiconv.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh -cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh +# cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh if [ ! -d $sourcePath/php/php${PHP_VER} ];then @@ -48,7 +48,8 @@ if [ $sysName == 'Darwin' ]; then export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig" export LDFLAGS="-L/usr/local/opt/libxml2/lib" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/81/install.sh b/plugins/php/versions/81/install.sh index f8cace7da..9909202d9 100755 --- a/plugins/php/versions/81/install.sh +++ b/plugins/php/versions/81/install.sh @@ -23,7 +23,7 @@ mkdir -p $serverPath/php cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash freetype_new.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libiconv.sh cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash zlib.sh -cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh +# cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libzip.sh if [ ! -d $sourcePath/php/php${PHP_VER} ];then @@ -49,10 +49,9 @@ if [ $sysName == 'Darwin' ]; then export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig" export LDFLAGS="-L/usr/local/opt/libxml2/lib" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" - OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" - OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip" fi diff --git a/plugins/php/versions/82/install.sh b/plugins/php/versions/82/install.sh index e792c55e1..ae094f3f7 100755 --- a/plugins/php/versions/82/install.sh +++ b/plugins/php/versions/82/install.sh @@ -44,8 +44,8 @@ if [ $sysName == 'Darwin' ]; then OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" # OPTIONS="${OPTIONS} --enable-zip" else - OPTIONS="--with-iconv=${serverPath}/lib/libiconv" - OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype" + OPTIONS='--without-iconv' + # OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-curl" OPTIONS="${OPTIONS} --with-libzip=${serverPath}/lib/libzip" fi diff --git a/plugins/php/versions/common/gd.sh b/plugins/php/versions/common/gd.sh index 9d3fa29b8..462f72063 100755 --- a/plugins/php/versions/common/gd.sh +++ b/plugins/php/versions/common/gd.sh @@ -47,6 +47,7 @@ Install_lib() echo "php-$version 已安装${LIBNAME},请选择其它版本!" return fi + if [ ! -f "$extFile" ];then diff --git a/plugins/php/versions/common/iconv.sh b/plugins/php/versions/common/iconv.sh new file mode 100755 index 000000000..6b87bc08c --- /dev/null +++ b/plugins/php/versions/common/iconv.sh @@ -0,0 +1,107 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +appPath=$(dirname "$curPath") + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=iconv +LIBV=0 + + + +LIB_PATH_NAME=lib/php +if [ -d $serverPath/php/${version}/lib64 ];then + LIB_PATH_NAME=lib64 +fi + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/${LIB_PATH_NAME}/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/${LIB_PATH_NAME}/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +sysName=`uname` +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + cd $serverPath/mdserver-web/plugins/php/lib && /bin/bash libiconv.sh + + if [ ! -f "$extFile" ];then + + if [ ! -d $sourcePath/php${version}/ext ];then + cd $serverPath/mdserver-web/plugins/php && /bin/bash install.sh install ${version} + fi + + cd $sourcePath/php${version}/ext/${LIBNAME} + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make clean && make && make install && make clean + + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 26716cdef..73414fc9e 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -502,11 +502,6 @@ { "name": "zip", "versions": [ - "73", - "74", - "80", - "81", - "82" ], "type": "压缩", "msg": "压缩组件",