From 255bcc2b743c46ed0703b4a8caaf12dec5bc7269 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 8 Mar 2019 18:52:37 +0800 Subject: [PATCH] update --- plugins/php/versions/53/eaccelerator.sh | 9 ++- plugins/php/versions/53/intl.sh | 13 ++- plugins/php/versions/53/redis.sh | 16 ++-- plugins/php/versions/53/yaf.sh | 6 +- plugins/php/versions/54/apc.sh | 92 ++++++++++++++++++++++ plugins/php/versions/54/intl.sh | 90 +++++++++++++++++++++ plugins/php/versions/54/memcache.sh | 85 ++++++++++++++++++++ plugins/php/versions/54/memcached.sh | 88 +++++++++++++++++++++ plugins/php/versions/54/redis.sh | 21 ++--- plugins/php/versions/54/swoole.sh | 100 ++++++++++++++++++++++++ plugins/php/versions/54/xdebug.sh | 91 +++++++++++++++++++++ plugins/php/versions/54/xhprof.sh | 88 +++++++++++++++++++++ plugins/php/versions/54/yaf.sh | 99 +++++++++++++++++++++++ plugins/php/versions/55/intl.sh | 90 +++++++++++++++++++++ plugins/php/versions/55/memcache.sh | 85 ++++++++++++++++++++ plugins/php/versions/55/memcached.sh | 88 +++++++++++++++++++++ plugins/php/versions/55/redis.sh | 21 ++--- plugins/php/versions/55/swoole.sh | 100 ++++++++++++++++++++++++ plugins/php/versions/55/xdebug.sh | 91 +++++++++++++++++++++ plugins/php/versions/55/xhprof.sh | 88 +++++++++++++++++++++ plugins/php/versions/55/yaf.sh | 99 +++++++++++++++++++++++ plugins/php/versions/56/memcache.sh | 31 ++++---- plugins/php/versions/56/memcached.sh | 88 +++++++++++++++++++++ plugins/php/versions/phplib.conf | 4 +- 24 files changed, 1531 insertions(+), 52 deletions(-) create mode 100755 plugins/php/versions/54/apc.sh create mode 100755 plugins/php/versions/54/intl.sh create mode 100755 plugins/php/versions/54/memcache.sh create mode 100755 plugins/php/versions/54/memcached.sh create mode 100755 plugins/php/versions/54/swoole.sh create mode 100755 plugins/php/versions/54/xdebug.sh create mode 100755 plugins/php/versions/54/xhprof.sh create mode 100755 plugins/php/versions/54/yaf.sh create mode 100755 plugins/php/versions/55/intl.sh create mode 100755 plugins/php/versions/55/memcache.sh create mode 100755 plugins/php/versions/55/memcached.sh create mode 100755 plugins/php/versions/55/swoole.sh create mode 100755 plugins/php/versions/55/xdebug.sh create mode 100755 plugins/php/versions/55/xhprof.sh create mode 100755 plugins/php/versions/55/yaf.sh create mode 100755 plugins/php/versions/56/memcached.sh diff --git a/plugins/php/versions/53/eaccelerator.sh b/plugins/php/versions/53/eaccelerator.sh index cce182e63..5ddd7ac16 100755 --- a/plugins/php/versions/53/eaccelerator.sh +++ b/plugins/php/versions/53/eaccelerator.sh @@ -2,8 +2,12 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH -curPath=`pwd` +# php 5.2.17 + eaccelerator 0.9.5.3 +# php 5.3.24 + eaccelerator 0.9.6.1 +# php 5.4.14 + eaccelerator 1.0 dev + +curPath=`pwd` rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") rootPath=$(dirname "$rootPath") @@ -38,7 +42,8 @@ Install_lib() cd $php_lib && tar jxvf ${LIBNAME}-${LIBV}.tar.bz2 cd ${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config --enable-eaccelerator=shared --with-eaccelerator-shared-memory + ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ + --enable-eaccelerator=shared --with-eaccelerator-shared-memory make && make install cd $php_lib diff --git a/plugins/php/versions/53/intl.sh b/plugins/php/versions/53/intl.sh index 01595c8e5..a4cafdceb 100755 --- a/plugins/php/versions/53/intl.sh +++ b/plugins/php/versions/53/intl.sh @@ -49,6 +49,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 @@ -60,18 +63,20 @@ 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 未安装${LIBNAME},请选择其它版本!" - echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + 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}.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/53/redis.sh b/plugins/php/versions/53/redis.sh index fdec422eb..c52fb624d 100755 --- a/plugins/php/versions/53/redis.sh +++ b/plugins/php/versions/53/redis.sh @@ -12,6 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=redis +LIBV=4.2.0 sysName=`uname` actionType=$1 version=$2 @@ -32,12 +33,12 @@ Install_lib() php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - if [ ! -f $php_lib/redis-4.2.0.tgz ];then - wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz + if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz fi - cd $php_lib && tar xvf redis-4.2.0.tgz - cd redis-4.2.0 + 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 make && make install @@ -50,7 +51,9 @@ Install_lib() echo "ERROR!" return fi - echo "extension=redis.so" >> $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,7 +75,8 @@ Uninstall_lib() return fi - sed -i '_bak' '/redis.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/53/yaf.sh b/plugins/php/versions/53/yaf.sh index 955132eb7..85c4904a9 100755 --- a/plugins/php/versions/53/yaf.sh +++ b/plugins/php/versions/53/yaf.sh @@ -17,7 +17,7 @@ LIBV='2.3.5' actionType=$1 version=$2 -extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/yaf.so +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then LIBV='3.0.7'; @@ -58,8 +58,8 @@ Install_lib() fi echo "" >> $serverPath/php/$version/etc/php.ini - echo "[yaf]" >> $serverPath/php/$version/etc/php.ini - echo "extension=yaf.so" >> $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 "yaf.use_namespace=1" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload diff --git a/plugins/php/versions/54/apc.sh b/plugins/php/versions/54/apc.sh new file mode 100755 index 000000000..e18fa60ed --- /dev/null +++ b/plugins/php/versions/54/apc.sh @@ -0,0 +1,92 @@ +#!/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=apc +LIBV=3.1.9 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${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 + + _LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]') + 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 + make && make install + + cd $php_lib + + rm -rf ${_LIBNAME}-${LIBV} + rm -rf ${_LIBNAME}-${LIBV}.tgz + 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 + + echo $extFile + 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/54/intl.sh b/plugins/php/versions/54/intl.sh new file mode 100755 index 000000000..272390372 --- /dev/null +++ b/plugins/php/versions/54/intl.sh @@ -0,0 +1,90 @@ +#!/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=intl +LIBV=3.0.0 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${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 \ + --with-openssl-dir=$serverPath/php/lib/openssl/ + 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/54/memcache.sh b/plugins/php/versions/54/memcache.sh new file mode 100755 index 000000000..83eddf4a5 --- /dev/null +++ b/plugins/php/versions/54/memcache.sh @@ -0,0 +1,85 @@ +#!/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=memcache +LIBV=2.2.7 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${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 + make && make install + + cd $php_lib + rm -rf ${LIBNAME}-* + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + 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 '===========================================================' + 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 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/memcached.sh b/plugins/php/versions/54/memcached.sh new file mode 100755 index 000000000..5ded7e59f --- /dev/null +++ b/plugins/php/versions/54/memcached.sh @@ -0,0 +1,88 @@ +#!/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=memcached +LIBV=2.2.0 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${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 "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/54/redis.sh b/plugins/php/versions/54/redis.sh index 47544c9f8..37aa3405d 100755 --- a/plugins/php/versions/54/redis.sh +++ b/plugins/php/versions/54/redis.sh @@ -12,11 +12,12 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=redis +LIBV=4.2.0 sysName=`uname` actionType=$1 version=$2 -extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/ +extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/ Install_lib() { @@ -32,26 +33,27 @@ Install_lib() php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - if [ ! -f $php_lib/redis-4.2.0.tgz ];then - wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz + if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz fi - cd $php_lib && tar xvf redis-4.2.0.tgz - cd redis-4.2.0 + 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 make && make install cd $php_lib - rm -rf redis-* - rm -f package.xml + rm -rf ${LIBNAME}-* fi sleep 1 if [ ! -f "$extFile" ];then echo "ERROR!" return fi - echo "extension=redis.so" >> $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 '===========================================================' @@ -73,7 +75,8 @@ Uninstall_lib() return fi - sed -i '_bak' '/redis.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/54/swoole.sh b/plugins/php/versions/54/swoole.sh new file mode 100755 index 000000000..ba4080481 --- /dev/null +++ b/plugins/php/versions/54/swoole.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 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/swoole.so + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep 'swoole.so'` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装yaf,请选择其它版本!" + 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 + cd $php_lib + tar xvf swoole-$wafV.tgz + cd swoole-$wafV + + $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 ${LIBNAME}-* + fi + + 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 "extension=$extFile" + echo "extension=$extFile" >> $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 未安装swoole,请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/swoole.so/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/xdebug.sh b/plugins/php/versions/54/xdebug.sh new file mode 100755 index 000000000..39362b589 --- /dev/null +++ b/plugins/php/versions/54/xdebug.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=xdebug +LIBV=2.2.7 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${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/54/xhprof.sh b/plugins/php/versions/54/xhprof.sh new file mode 100755 index 000000000..f4dce1689 --- /dev/null +++ b/plugins/php/versions/54/xhprof.sh @@ -0,0 +1,88 @@ +#!/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=xhprof +LIBV=0.9.4 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${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}/extension + $serverPath/php/$version/bin/phpize + ./configure --enable-xhprof --with-php-config=$serverPath/php/$version/bin/php-config + 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/54/yaf.sh b/plugins/php/versions/54/yaf.sh new file mode 100755 index 000000000..c16b43845 --- /dev/null +++ b/plugins/php/versions/54/yaf.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=yaf +LIBV='2.3.5' + +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so + +if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then + LIBV='3.0.7'; +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装yaf,请选择其它版本!" + 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 + make && make install + cd .. + rm -rf yaf-* + rm -f package.xml + 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 + echo "yaf.use_namespace=1" >> $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 未安装yaf,请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/yaf.so/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/yaf.use_namespace/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/\[yaf\]/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/55/intl.sh b/plugins/php/versions/55/intl.sh new file mode 100755 index 000000000..99cb5b053 --- /dev/null +++ b/plugins/php/versions/55/intl.sh @@ -0,0 +1,90 @@ +#!/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=intl +LIBV=3.0.0 +sysName=`uname` +actionType=$1 +version=$2 +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 "${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 \ + --with-openssl-dir=$serverPath/php/lib/openssl/ + 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/55/memcache.sh b/plugins/php/versions/55/memcache.sh new file mode 100755 index 000000000..d61be87cb --- /dev/null +++ b/plugins/php/versions/55/memcache.sh @@ -0,0 +1,85 @@ +#!/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=memcache +LIBV=2.2.7 +sysName=`uname` +actionType=$1 +version=$2 +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 "${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 + make && make install + + cd $php_lib + rm -rf ${LIBNAME}-* + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + 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 '===========================================================' + 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 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/55/memcached.sh b/plugins/php/versions/55/memcached.sh new file mode 100755 index 000000000..302c6426e --- /dev/null +++ b/plugins/php/versions/55/memcached.sh @@ -0,0 +1,88 @@ +#!/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=memcached +LIBV=2.2.0 +sysName=`uname` +actionType=$1 +version=$2 +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 "${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 "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/55/redis.sh b/plugins/php/versions/55/redis.sh index 47544c9f8..2163326bc 100755 --- a/plugins/php/versions/55/redis.sh +++ b/plugins/php/versions/55/redis.sh @@ -12,11 +12,12 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=redis +LIBV=4.2.0 sysName=`uname` actionType=$1 version=$2 -extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/ +extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/ Install_lib() { @@ -32,26 +33,27 @@ Install_lib() php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - if [ ! -f $php_lib/redis-4.2.0.tgz ];then - wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz + if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz fi - cd $php_lib && tar xvf redis-4.2.0.tgz - cd redis-4.2.0 + 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 make && make install cd $php_lib - rm -rf redis-* - rm -f package.xml + rm -rf ${LIBNAME}-* fi sleep 1 if [ ! -f "$extFile" ];then echo "ERROR!" return fi - echo "extension=redis.so" >> $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 '===========================================================' @@ -73,7 +75,8 @@ Uninstall_lib() return fi - sed -i '_bak' '/redis.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/55/swoole.sh b/plugins/php/versions/55/swoole.sh new file mode 100755 index 000000000..5eb93d6c5 --- /dev/null +++ b/plugins/php/versions/55/swoole.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 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/swoole.so + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep 'swoole.so'` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装yaf,请选择其它版本!" + 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 + cd $php_lib + tar xvf swoole-$wafV.tgz + cd swoole-$wafV + + $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 ${LIBNAME}-* + fi + + 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 "extension=$extFile" + echo "extension=$extFile" >> $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 未安装swoole,请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/swoole.so/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/55/xdebug.sh b/plugins/php/versions/55/xdebug.sh new file mode 100755 index 000000000..ec71c93ba --- /dev/null +++ b/plugins/php/versions/55/xdebug.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=xdebug +LIBV=2.2.7 +sysName=`uname` +actionType=$1 +version=$2 +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 "${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/55/xhprof.sh b/plugins/php/versions/55/xhprof.sh new file mode 100755 index 000000000..93b8b7699 --- /dev/null +++ b/plugins/php/versions/55/xhprof.sh @@ -0,0 +1,88 @@ +#!/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=xhprof +LIBV=0.9.4 +sysName=`uname` +actionType=$1 +version=$2 +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 "${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}/extension + $serverPath/php/$version/bin/phpize + ./configure --enable-xhprof --with-php-config=$serverPath/php/$version/bin/php-config + 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/55/yaf.sh b/plugins/php/versions/55/yaf.sh new file mode 100755 index 000000000..752700117 --- /dev/null +++ b/plugins/php/versions/55/yaf.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=yaf +LIBV='2.3.5' + +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so + +if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then + LIBV='3.0.7'; +fi + +Install_lib() +{ + + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装yaf,请选择其它版本!" + 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 + make && make install + cd .. + rm -rf yaf-* + rm -f package.xml + 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 + echo "yaf.use_namespace=1" >> $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 未安装yaf,请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/yaf.so/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/yaf.use_namespace/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/\[yaf\]/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/memcache.sh b/plugins/php/versions/56/memcache.sh index 1b73cbe04..f16685a58 100755 --- a/plugins/php/versions/56/memcache.sh +++ b/plugins/php/versions/56/memcache.sh @@ -12,8 +12,11 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=memcache - +LIBV=2.2.7 sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so Install_lib() { @@ -23,30 +26,28 @@ Install_lib() return fi - extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so if [ ! -f "$extFile" ];then - php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - wget -O $php_lib/memcache-2.2.7.tgz http://pecl.php.net/get/memcache-2.2.7.tgz + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz - cd $php_lib && tar xvf memcache-2.2.7.tgz - cd memcache-2.2.7 + 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 make && make install cd $php_lib - rm -rf memcache-* - rm -f package.xml + rm -rf ${LIBNAME}-* fi if [ ! -f "$extFile" ];then echo "ERROR!" return fi - echo "extension=memcache.so" >> $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 '===========================================================' @@ -57,18 +58,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/${LIBNAME}.so if [ ! -f "$extFile" ];then - echo "php$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$vphp not install memcache, Plese select other version!" + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$version not install memcache, Plese select other version!" return fi - sed -i '_bak' '/memcache.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 @@ -77,8 +78,6 @@ Uninstall_lib() } -actionType=$1 -version=$2 if [ "$actionType" == 'install' ];then Install_lib elif [ "$actionType" == 'uninstall' ];then diff --git a/plugins/php/versions/56/memcached.sh b/plugins/php/versions/56/memcached.sh new file mode 100755 index 000000000..aa9503973 --- /dev/null +++ b/plugins/php/versions/56/memcached.sh @@ -0,0 +1,88 @@ +#!/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=memcached +LIBV=2.2.0 +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 "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/phplib.conf b/plugins/php/versions/phplib.conf index ff94f1270..0fc98bab4 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -180,9 +180,7 @@ { "name": "eAccelerator", "versions": [ - "52", - "53", - "54" + "53" ], "type": "缓存器", "msg": "内容缓存器",