diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index 082c30c9a..59be33140 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -43,9 +43,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi # --enable-intl \ diff --git a/plugins/php/versions/53/redis.sh b/plugins/php/versions/53/redis.sh index c52fb624d..7d86e4560 100755 --- a/plugins/php/versions/53/redis.sh +++ b/plugins/php/versions/53/redis.sh @@ -52,6 +52,7 @@ Install_lib() 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/53/solr.sh b/plugins/php/versions/53/solr.sh new file mode 100755 index 000000000..a861a1e0d --- /dev/null +++ b/plugins/php/versions/53/solr.sh @@ -0,0 +1,99 @@ +#!/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.4.0 +sysName=`uname` +actionType=$1 +version=$2 + +extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/ + +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 + + php_lib=$sourcePath/php_${version}_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 + fi + + OPTIONS='' + if [ $sysName == 'Darwin' ]; then + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" + fi + + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + cd ${LIBNAME}-${LIBV} + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS + make && make install + + cd $php_lib + rm -rf ${LIBNAME}-* + 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 memcache, 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/54/install.sh b/plugins/php/versions/54/install.sh index 74db9a530..b9ac2a576 100755 --- a/plugins/php/versions/54/install.sh +++ b/plugins/php/versions/54/install.sh @@ -31,9 +31,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi cd $sourcePath/php/php-5.4.45 && ./configure \ diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh index 7a5c27b7c..e30ff826f 100755 --- a/plugins/php/versions/55/install.sh +++ b/plugins/php/versions/55/install.sh @@ -28,9 +28,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/56/install.sh b/plugins/php/versions/56/install.sh index 7ab27dc24..f1f2239d7 100755 --- a/plugins/php/versions/56/install.sh +++ b/plugins/php/versions/56/install.sh @@ -29,9 +29,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi cd $sourcePath/php/php-5.6.36 && ./configure \ diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index 9aa554826..9c91acc9b 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -29,9 +29,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index a1a03e1c8..33461b729 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -29,9 +29,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index 59e266d81..47f2ddafc 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -30,9 +30,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index b76b19d6f..5336a4a81 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -31,9 +31,11 @@ fi OPTIONS='' if [ $sysName == 'Darwin' ]; then OPTIONS='--without-iconv' + OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl" else OPTIONS="--with-iconv=${serverPath}/lib/libiconv" OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf" + OPTIONS="${OPTIONS} --with-curl" fi diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 988a1a9e3..74f42085f 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -242,5 +242,17 @@ "msg": "高性能无锁共享内存Cache", "shell": "yac.sh", "check": "yac.so" + }, + { + "name": "solr", + "versions": [ + "53", + "54", + "55" + ], + "type": "大数据", + "msg": "SOLR全文搜索服务", + "shell": "solr.sh", + "check": "solr.so" } ] \ No newline at end of file diff --git a/scripts/install_centos.sh b/scripts/install_centos.sh index 9523ac455..bf0f14b01 100755 --- a/scripts/install_centos.sh +++ b/scripts/install_centos.sh @@ -15,6 +15,7 @@ if [ ! -f /usr/bin/applydeltarpm ];then yum -y install deltarpm fi +yum install -y wget curl libcurl #https need curl https://get.acme.sh | sh @@ -49,7 +50,7 @@ if [ "${isVersion}" == '' ];then fi -yum install -y wget curl libzip-devel mysql-devel libjpeg* libpng* freetype* gd* +yum install -y libzip-devel mysql-devel libjpeg* libpng* freetype* gd* if [ ! -d '/www/server/mdserver-web' ];then wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master diff --git a/scripts/lib.sh b/scripts/lib.sh index abe239dca..cabe643d8 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -45,37 +45,6 @@ echo -e "Install_Libmemcached" >> ${libPath}/lib.pl } -Install_Jpegsrc(){ -#----------------------------- Jpegsrc start -------------------------# -if [ ! -d ${libPath}/jpegsrc ];then - cd ${sourcePath} - if [ ! -f ${sourcePath}/jpegsrc.v9c.tar.gz ];then - wget -O jpegsrc.v9c.tar.gz http://www.ijg.org/files/jpegsrc.v9c.tar.gz -T 20 - fi - tar -zxf jpegsrc.v9c.tar.gz - cd jpeg-9c - ./configure --prefix=${libPath}/jpegsrc && make && make install -fi -echo -e "Install_Jpegsrc" >> ${libPath}/lib.pl -#----------------------------- Jpegsrc end -------------------------# -} - - -Install_GD(){ -#----------------------------- Jpegsrc start -------------------------# -if [ ! -d ${libPath}/libgd ];then - cd ${sourcePath} - if [ ! -f ${sourcePath}/libgd-2.2.5.tar.gz ];then - wget -O libgd-2.2.5.tar.gz https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz -T 20 - fi - tar -zxf libgd-2.2.5.tar.gz - cd libgd-2.2.5 - ./configure --prefix=${libPath}/libgd && make && make install -fi -echo -e "Install_GD" >> ${libPath}/lib.pl -#----------------------------- Jpegsrc end -------------------------# -} - Install_Libiconv() { #----------------------------- libiconv end -------------------------# @@ -142,44 +111,6 @@ Install_Mcrypt() echo -e "Install_Mcrypt" >> /www/server/lib.pl } -Install_Mhash() -{ - if [ -f '/usr/local/lib/libmhash.so' ];then - return; - fi - cd ${run_path} - if [ ! -f "mhash-0.9.9.9.tar.gz" ];then - wget -O mhash-0.9.9.9.tar.gz ${download_Url}/src/mhash-0.9.9.9.tar.gz -T 5 - fi - tar zxf mhash-0.9.9.9.tar.gz - cd mhash-0.9.9.9 - ./configure - make && make install - ln -sf /usr/local/lib/libmhash.a /usr/lib/libmhash.a - ln -sf /usr/local/lib/libmhash.la /usr/lib/libmhash.la - ln -sf /usr/local/lib/libmhash.so /usr/lib/libmhash.so - ln -sf /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 - ln -sf /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1 - ldconfig - cd ${run_path} - rm -rf mhash-0.9.9.9* - echo -e "Install_Mhash" >> /www/server/lib.pl -} - - -Install_Freetype() -{ - cd ${sourcePath} - if [ ! -d ${libPath}/freetype ];then - wget -O freetype-2.4.12.tar.gz https://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz -T 5 - tar zxf freetype-2.4.12.tar.gz - cd freetype-2.4.12 - ./configure --prefix=${libPath}/freetype - make && make install - fi - echo -e "Install_Freetype" >> ${libPath}/lib.pl -} - Install_Pcre() { Cur_Pcre_Ver=`pcre-config --version|grep '^8.' 2>&1` @@ -237,17 +168,28 @@ Install_Lib() fi } + +Install_Curl() +{ +#----------------------------- curl start -------------------------# +if [ ! -d ${libPath}/curl ];then + cd ${sourcePath} + if [ ! -f ${sourcePath}/curl-7.64.0.tar.gz ];then + wget https://curl.haxx.se/download/curl-7.64.0.tar.gz -T 20 + fi + tar -zxf curl-7.64.0.tar.gz + cd curl-7.64.0 + ./configure --prefix=${libPath}/curl --with-ssl=${libPath}/openssl + make && make install +fi +echo -e "Install_Curl" >> ${libPath}/lib.pl +#----------------------------- curl end -------------------------# +} + Install_Zlib -# Install_Lib Install_Libmemcached -Install_OpenSSL -# Install_Pcre -# Install_Mhash -# Install_Libmcrypt -# Install_Mcrypt +Install_OpenSSL Install_Libiconv -Install_Jpegsrc -Install_Freetype -Install_GD +Install_Curl