From f79e073cc95d0c44f6439cb8f32663f944a5feee Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 3 Dec 2021 21:30:59 +0800 Subject: [PATCH] up --- plugins/php/versions/72/mcrypt.sh | 9 +++ plugins/php/versions/72/openssl.sh | 9 +++ plugins/php/versions/73/mcrypt.sh | 10 ++- plugins/php/versions/73/openssl.sh | 100 +++++++++++++++++++++++++++++ plugins/php/versions/74/mcrypt.sh | 97 ++++++++++++++++++++++++++++ plugins/php/versions/74/openssl.sh | 100 +++++++++++++++++++++++++++++ plugins/php/versions/80/mcrypt.sh | 97 ++++++++++++++++++++++++++++ plugins/php/versions/80/openssl.sh | 100 +++++++++++++++++++++++++++++ plugins/php/versions/81/mcrypt.sh | 97 ++++++++++++++++++++++++++++ plugins/php/versions/81/openssl.sh | 100 +++++++++++++++++++++++++++++ plugins/php/versions/phplib.conf | 11 +++- 11 files changed, 727 insertions(+), 3 deletions(-) create mode 100755 plugins/php/versions/73/openssl.sh create mode 100755 plugins/php/versions/74/mcrypt.sh create mode 100755 plugins/php/versions/74/openssl.sh create mode 100755 plugins/php/versions/80/mcrypt.sh create mode 100755 plugins/php/versions/80/openssl.sh create mode 100755 plugins/php/versions/81/mcrypt.sh create mode 100755 plugins/php/versions/81/openssl.sh diff --git a/plugins/php/versions/72/mcrypt.sh b/plugins/php/versions/72/mcrypt.sh index d8865b35e..73a1fcbf9 100755 --- a/plugins/php/versions/72/mcrypt.sh +++ b/plugins/php/versions/72/mcrypt.sh @@ -38,6 +38,10 @@ Install_lib() 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} @@ -47,6 +51,11 @@ Install_lib() 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 diff --git a/plugins/php/versions/72/openssl.sh b/plugins/php/versions/72/openssl.sh index d93233b72..165e01bd2 100755 --- a/plugins/php/versions/72/openssl.sh +++ b/plugins/php/versions/72/openssl.sh @@ -38,6 +38,10 @@ Install_lib() 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} if [ ! -f "config.m4" ];then @@ -50,6 +54,11 @@ Install_lib() 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 diff --git a/plugins/php/versions/73/mcrypt.sh b/plugins/php/versions/73/mcrypt.sh index 634cee877..73a1fcbf9 100755 --- a/plugins/php/versions/73/mcrypt.sh +++ b/plugins/php/versions/73/mcrypt.sh @@ -17,7 +17,6 @@ version=$2 LIBNAME=mcrypt LIBV=0 - NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so @@ -39,6 +38,10 @@ Install_lib() 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} @@ -48,6 +51,11 @@ Install_lib() 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 diff --git a/plugins/php/versions/73/openssl.sh b/plugins/php/versions/73/openssl.sh new file mode 100755 index 000000000..165e01bd2 --- /dev/null +++ b/plugins/php/versions/73/openssl.sh @@ -0,0 +1,100 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/74/mcrypt.sh b/plugins/php/versions/74/mcrypt.sh new file mode 100755 index 000000000..73a1fcbf9 --- /dev/null +++ b/plugins/php/versions/74/mcrypt.sh @@ -0,0 +1,97 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=mcrypt +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/74/openssl.sh b/plugins/php/versions/74/openssl.sh new file mode 100755 index 000000000..165e01bd2 --- /dev/null +++ b/plugins/php/versions/74/openssl.sh @@ -0,0 +1,100 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/80/mcrypt.sh b/plugins/php/versions/80/mcrypt.sh new file mode 100755 index 000000000..73a1fcbf9 --- /dev/null +++ b/plugins/php/versions/80/mcrypt.sh @@ -0,0 +1,97 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=mcrypt +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/80/openssl.sh b/plugins/php/versions/80/openssl.sh new file mode 100755 index 000000000..165e01bd2 --- /dev/null +++ b/plugins/php/versions/80/openssl.sh @@ -0,0 +1,100 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/81/mcrypt.sh b/plugins/php/versions/81/mcrypt.sh new file mode 100755 index 000000000..73a1fcbf9 --- /dev/null +++ b/plugins/php/versions/81/mcrypt.sh @@ -0,0 +1,97 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=mcrypt +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/81/openssl.sh b/plugins/php/versions/81/openssl.sh new file mode 100755 index 000000000..165e01bd2 --- /dev/null +++ b/plugins/php/versions/81/openssl.sh @@ -0,0 +1,100 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +actionType=$1 +version=$2 + +LIBNAME=openssl +LIBV=0 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/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 + + 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} + + if [ ! -f "config.m4" ];then + mv config0.m4 config.m4 + fi + + $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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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 8f6827ba7..cfb85347f 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -54,7 +54,11 @@ "versions": [ "56", "71", - "72" + "72", + "73", + "74", + "80", + "81" ], "type": "通用扩展", "msg": "SSL!", @@ -66,7 +70,10 @@ "versions": [ "71", "72", - "73" + "73", + "74", + "80", + "81" ], "type": "通用扩展", "msg": "加密软件!",