diff --git a/plugins/php/versions/71/solr.sh b/plugins/php/versions/71/solr.sh index 8afdf5bd3..7772ba744 100755 --- a/plugins/php/versions/71/solr.sh +++ b/plugins/php/versions/71/solr.sh @@ -80,7 +80,7 @@ Uninstall_lib() extFile=$extDir${LIBNAME}.so if [ ! -f "$extFile" ];then echo "php$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$vphp not install memcache, Plese select other version!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" return fi diff --git a/plugins/php/versions/72/solr.sh b/plugins/php/versions/72/solr.sh index db39443b5..7ffdcad67 100755 --- a/plugins/php/versions/72/solr.sh +++ b/plugins/php/versions/72/solr.sh @@ -80,7 +80,7 @@ Uninstall_lib() extFile=$extDir${LIBNAME}.so if [ ! -f "$extFile" ];then echo "php$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$vphp not install memcache, Plese select other version!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" return fi diff --git a/plugins/php/versions/73/solr.sh b/plugins/php/versions/73/solr.sh index 242bfc917..2ca711a6d 100755 --- a/plugins/php/versions/73/solr.sh +++ b/plugins/php/versions/73/solr.sh @@ -81,7 +81,7 @@ Uninstall_lib() extFile=$extDir${LIBNAME}.so if [ ! -f "$extFile" ];then echo "php$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$vphp not install memcache, Plese select other version!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" return fi diff --git a/plugins/php/versions/74/solr.sh b/plugins/php/versions/74/solr.sh new file mode 100755 index 000000000..0d59e5013 --- /dev/null +++ b/plugins/php/versions/74/solr.sh @@ -0,0 +1,102 @@ +#!/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 + +LIBNAME=solr +LIBV=2.5.1 +sysName=`uname` +actionType=$1 +version=$2 + +extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/ + +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 + + extFile=$extDir${LIBNAME}.so + if [ ! -f "$extFile" ];then + + OPTIONS='' + if [ $sysName == 'Darwin' ]; then + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" + fi + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + + if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + fi + + cd $php_lib/${LIBNAME}-${LIBV} + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + make && make install && make clean + fi + sleep 1 + 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 + + extFile=$extDir${LIBNAME}.so + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + 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/solr.sh b/plugins/php/versions/80/solr.sh new file mode 100755 index 000000000..07e85aff8 --- /dev/null +++ b/plugins/php/versions/80/solr.sh @@ -0,0 +1,102 @@ +#!/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 + +LIBNAME=solr +LIBV=2.5.1 +sysName=`uname` +actionType=$1 +version=$2 + +extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/ + +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 + + extFile=$extDir${LIBNAME}.so + if [ ! -f "$extFile" ];then + + OPTIONS='' + if [ $sysName == 'Darwin' ]; then + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" + fi + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + + if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + fi + + cd $php_lib/${LIBNAME}-${LIBV} + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + make && make install && make clean + fi + sleep 1 + 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 + + extFile=$extDir${LIBNAME}.so + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + return + fi + + 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 48a8e1ad0..190808604 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -307,7 +307,9 @@ "70", "71", "72", - "73" + "73", + "74", + "80" ], "type": "大数据", "msg": "SOLR全文搜索服务",