diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index c2750a308..c58ede47c 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -55,7 +55,6 @@ cd $sourcePath/php/php-5.3.29 && ./configure \ --with-zlib-dir=$serverPath/lib/zlib \ --enable-mysqlnd \ --without-iconv \ ---with-gd=$serverPath/lib/libgd \ --enable-zip \ --enable-sockets \ --enable-mbstring \ diff --git a/plugins/php/versions/53/memcache.sh b/plugins/php/versions/53/memcache.sh index 1420762f8..6ad773701 100755 --- a/plugins/php/versions/53/memcache.sh +++ b/plugins/php/versions/53/memcache.sh @@ -46,8 +46,10 @@ Install_lib() 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 - echo "extension=${LIBNAME}" >> $serverPath/php/$version/etc/php.ini + $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/53/memcached.sh b/plugins/php/versions/53/memcached.sh index f7c9d150b..72f43ea04 100755 --- a/plugins/php/versions/53/memcached.sh +++ b/plugins/php/versions/53/memcached.sh @@ -50,6 +50,9 @@ Install_lib() 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 diff --git a/plugins/php/versions/53/opcache.sh b/plugins/php/versions/53/opcache.sh index fc024c3bb..8687198a1 100755 --- a/plugins/php/versions/53/opcache.sh +++ b/plugins/php/versions/53/opcache.sh @@ -50,7 +50,7 @@ Install_lib() fi echo "" >> $serverPath/php/$version/etc/php.ini - echo "[opcache]" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.memory_consumption=128" >> $serverPath/php/$version/etc/php.ini diff --git a/plugins/php/versions/54/intl.sh b/plugins/php/versions/54/imagemagick.sh similarity index 88% rename from plugins/php/versions/54/intl.sh rename to plugins/php/versions/54/imagemagick.sh index 272390372..bdf6cb827 100755 --- a/plugins/php/versions/54/intl.sh +++ b/plugins/php/versions/54/imagemagick.sh @@ -11,8 +11,8 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php -LIBNAME=intl -LIBV=3.0.0 +LIBNAME=imagick +LIBV=3.4.3 sysName=`uname` actionType=$1 version=$2 @@ -38,7 +38,8 @@ Install_lib() cd ${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl-dir=$serverPath/php/lib/openssl/ + --enable-memcache --with-zlib-dir=$serverPath/lib/zlib \ + --with-libmemcached-dir=$serverPath/lib/libmemcached make && make install cd $php_lib @@ -73,8 +74,8 @@ Uninstall_lib() 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 + 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 diff --git a/plugins/php/versions/54/memcache.sh b/plugins/php/versions/54/memcache.sh index 83eddf4a5..bbefa9426 100755 --- a/plugins/php/versions/54/memcache.sh +++ b/plugins/php/versions/54/memcache.sh @@ -46,8 +46,10 @@ Install_lib() 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 - echo "extension=${LIBNAME}" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' diff --git a/plugins/php/versions/54/memcached.sh b/plugins/php/versions/54/memcached.sh index 5ded7e59f..424110568 100755 --- a/plugins/php/versions/54/memcached.sh +++ b/plugins/php/versions/54/memcached.sh @@ -50,6 +50,9 @@ Install_lib() 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 diff --git a/plugins/php/versions/54/opcache.sh b/plugins/php/versions/54/opcache.sh index 69780def8..12576f850 100755 --- a/plugins/php/versions/54/opcache.sh +++ b/plugins/php/versions/54/opcache.sh @@ -20,8 +20,40 @@ extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/ 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 + + php_lib=$sourcePath/php_${version}_lib + mkdir -p $php_lib + + wget -O $php_lib/zendopcache-7.0.5.tgz http://pecl.php.net/get/zendopcache-7.0.5.tgz + + cd $php_lib && tar xvf zendopcache-7.0.5.tgz + cd zendopcache-7.0.5 + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make && make install + + cp modules/opcache.la $serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/ + + cd $php_lib + # rm -rf zendopcache-7.0.5 + # rm -rf zendopcache-7.0.5.tgz + # rm -rf package.xml + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + echo "" >> $serverPath/php/$version/etc/php.ini - echo "[opcache]" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini echo "opcache.enable=1" >> $serverPath/php/$version/etc/php.ini echo "opcache.memory_consumption=128" >> $serverPath/php/$version/etc/php.ini @@ -38,10 +70,26 @@ Install_lib() Uninstall_lib() -{ +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$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 + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$version 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!' diff --git a/plugins/php/versions/55/intl.sh b/plugins/php/versions/55/imagemagick.sh similarity index 88% rename from plugins/php/versions/55/intl.sh rename to plugins/php/versions/55/imagemagick.sh index 99cb5b053..c416ed1df 100755 --- a/plugins/php/versions/55/intl.sh +++ b/plugins/php/versions/55/imagemagick.sh @@ -11,8 +11,8 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php -LIBNAME=intl -LIBV=3.0.0 +LIBNAME=imagick +LIBV=3.4.3 sysName=`uname` actionType=$1 version=$2 @@ -38,7 +38,8 @@ Install_lib() cd ${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl-dir=$serverPath/php/lib/openssl/ + --enable-memcache --with-zlib-dir=$serverPath/lib/zlib \ + --with-libmemcached-dir=$serverPath/lib/libmemcached make && make install cd $php_lib @@ -73,8 +74,8 @@ Uninstall_lib() 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 + 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 diff --git a/plugins/php/versions/55/swoole.sh b/plugins/php/versions/55/swoole.sh index 5eb93d6c5..54504fa42 100755 --- a/plugins/php/versions/55/swoole.sh +++ b/plugins/php/versions/55/swoole.sh @@ -13,30 +13,33 @@ sourcePath=${serverPath}/source/php actionType=$1 version=$2 -extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/swoole.so + + +LIBNAME=swoole +LIBV='1.10.1'; +if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then + LIBV='2.2.0' +fi +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so + Install_lib() { - isInstall=`cat $serverPath/php/$version/etc/php.ini|grep 'swoole.so'` + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep '${LIBNAME}.so'` if [ "${isInstall}" != "" ];then - echo "php-$version 已安装yaf,请选择其它版本!" + echo "php-$version 已安装${LIBNAME},请选择其它版本!" return fi if [ ! -f "$extFile" ];then - - wafV='1.10.1'; - if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then - wafV='2.2.0'; - fi php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - wget -O $php_lib/swoole-$wafV.tgz http://pecl.php.net/get/swoole-$wafV.tgz + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz cd $php_lib - tar xvf swoole-$wafV.tgz - cd swoole-$wafV + tar xvf ${LIBNAME}-${LIBV}.tgz + cd ${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ @@ -60,8 +63,9 @@ Install_lib() fi done - echo "extension=$extFile" - echo "extension=$extFile" >> $serverPath/php/$version/etc/php.ini + 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 '===========================================================' @@ -72,18 +76,18 @@ Install_lib() Uninstall_lib() { if [ ! -f "$serverPath/php/$version/bin/php-config" ];then - echo "php$version 未安装,请选择其它版本!" + echo "php-$version 未安装,请选择其它版本!" return fi - if [ ! -f "$extFile" ];then - echo "php$version 未安装swoole,请选择其它版本!" + echo "php-$version 未安装${LIBNAME},请选择其它版本!" return fi echo $serverPath/php/$version/etc/php.ini - sed -i '_bak' "/swoole.so/d" $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 diff --git a/plugins/php/versions/56/imagemagick.sh b/plugins/php/versions/56/imagemagick.sh new file mode 100755 index 000000000..064de046b --- /dev/null +++ b/plugins/php/versions/56/imagemagick.sh @@ -0,0 +1,91 @@ +#!/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=imagick +LIBV=3.4.3 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so + +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 + + php_lib=$sourcePath/php_${version}_lib + mkdir -p $php_lib + + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz + + 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 \ + --enable-memcache --with-zlib-dir=$serverPath/lib/zlib \ + --with-libmemcached-dir=$serverPath/lib/libmemcached + make && make install + + cd $php_lib + rm -rf ${LIBNAME}-* + 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},请选择其它版本!" + echo "php-$version 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/56/swoole.sh b/plugins/php/versions/56/swoole.sh index f488d81a3..a7166b483 100755 --- a/plugins/php/versions/56/swoole.sh +++ b/plugins/php/versions/56/swoole.sh @@ -11,45 +11,59 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php +actionType=$1 +version=$2 + + +LIBNAME=swoole +LIBV='1.10.1'; +if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then + LIBV='2.2.0' +fi +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so + + Install_lib() { - extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/swoole.so - isInstall=`cat $serverPath/php/$version/etc/php.ini|grep 'swoole.so'` + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep '${LIBNAME}.so'` if [ "${isInstall}" != "" ];then - echo "php-$version 已安装yaf,请选择其它版本!" + echo "php-$version 已安装${LIBNAME},请选择其它版本!" return fi if [ ! -f "$extFile" ];then - - wafV='1.10.1'; - if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then - wafV='2.2.0'; - fi php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - wget -O $php_lib/swoole-$wafV.tgz http://pecl.php.net/get/swoole-$wafV.tgz + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz cd $php_lib - tar xvf swoole-$wafV.tgz - cd swoole-$wafV + tar xvf ${LIBNAME}-${LIBV}.tgz + cd ${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ --enable-openssl --with-openssl-dir=$serverPath/lib/openssl --enable-sockets make && make install cd .. - rm -rf swoole-* - rm -f package.xml + rm -rf ${LIBNAME}-* fi - if [ ! -f "$extFile" ];then - echo "ERROR!" - return; - fi - - echo "" >> $serverPath/php/$version/etc/php.ini + while [[ ! -f "$extFile" ]]; + do + echo -e ".\c" + sleep 0.5 + if [ ! -f "$extFile" ];then + echo "ERROR!" + fi + let n+=1 + if [ $n -gt 8 ];then + echo "WAIT " $n "TIMES FAIL!" + return; + fi + done + + 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 @@ -62,18 +76,18 @@ Install_lib() Uninstall_lib() { if [ ! -f "$serverPath/php/$version/bin/php-config" ];then - echo "php$version 未安装,请选择其它版本!" + echo "php-$version 未安装,请选择其它版本!" return fi - extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/swoole.so if [ ! -f "$extFile" ];then - echo "php$version 未安装swoole,请选择其它版本!" + echo "php-$version 未安装${LIBNAME},请选择其它版本!" return fi echo $serverPath/php/$version/etc/php.ini - sed -i '_bak' '/swoole.so/d' $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 @@ -82,8 +96,7 @@ Uninstall_lib() } -actionType=$1 -version=$2 + if [ "$actionType" == 'install' ];then Install_lib elif [ "$actionType" == 'uninstall' ];then diff --git a/plugins/php/versions/53/intl.sh b/plugins/php/versions/56/xhprof.sh similarity index 88% rename from plugins/php/versions/53/intl.sh rename to plugins/php/versions/56/xhprof.sh index a4cafdceb..47d48d9fb 100755 --- a/plugins/php/versions/53/intl.sh +++ b/plugins/php/versions/56/xhprof.sh @@ -11,34 +11,31 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php -LIBNAME=intl -LIBV=3.0.0 +LIBNAME=xhprof +LIBV=0.9.4 sysName=`uname` actionType=$1 version=$2 -extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so Install_lib() { isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` if [ "${isInstall}" != "" ];then - echo "php$version 已安装${LIBNAME},请选择其它版本!" + echo "php-$version 已安装${LIBNAME},请选择其它版本!" return fi - if [ ! -f "$extFile" ];then - php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz - cd ${LIBNAME}-${LIBV} + cd ${LIBNAME}-${LIBV}/extension $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-openssl-dir=$serverPath/php/lib/openssl/ + ./configure --enable-xhprof --with-php-config=$serverPath/php/$version/bin/php-config make && make install cd $php_lib @@ -50,6 +47,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 @@ -76,7 +74,6 @@ Uninstall_lib() 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 '===============================================' diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 4e3ce97ac..a90dd0bf8 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -38,7 +38,9 @@ "55", "56", "70", - "71" + "71", + "72", + "73" ], "type": "缓存器", "msg": "用于加速PHP脚本!", @@ -126,7 +128,9 @@ "55", "56", "70", - "71" + "71", + "72", + "73" ], "type": "调试器", "msg": "不多说,不了解的不要安装",