diff --git a/plugins/php/versions/53/opcache.sh b/plugins/php/versions/53/opcache.sh index 6c771723e..fc024c3bb 100755 --- a/plugins/php/versions/53/opcache.sh +++ b/plugins/php/versions/53/opcache.sh @@ -51,7 +51,8 @@ Install_lib() echo "" >> $serverPath/php/$version/etc/php.ini echo "[opcache]" >> $serverPath/php/$version/etc/php.ini - echo "extension=${LIBNAME}.so" >> $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 echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini diff --git a/plugins/php/versions/53/xdebug.sh b/plugins/php/versions/53/xdebug.sh index 00b6639c3..19bb84895 100755 --- a/plugins/php/versions/53/xdebug.sh +++ b/plugins/php/versions/53/xdebug.sh @@ -37,9 +37,7 @@ Install_lib() 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 + ./configure --with-php-config=$serverPath/php/$version/bin/php-config make && make install cd $php_lib diff --git a/plugins/php/versions/54/opcache.sh b/plugins/php/versions/54/opcache.sh new file mode 100755 index 000000000..69780def8 --- /dev/null +++ b/plugins/php/versions/54/opcache.sh @@ -0,0 +1,55 @@ +#!/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=opcache +LIBV=7.0.5 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so + +Install_lib() +{ + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[opcache]" >> $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 + echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini + echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini + echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini + echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini + echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +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 + + $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/opcache.sh b/plugins/php/versions/55/opcache.sh new file mode 100755 index 000000000..84d18c31d --- /dev/null +++ b/plugins/php/versions/55/opcache.sh @@ -0,0 +1,55 @@ +#!/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=opcache +LIBV=7.0.5 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so + +Install_lib() +{ + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[opcache]" >> $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 + echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini + echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini + echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini + echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini + echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +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 + + $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/mongo.sh b/plugins/php/versions/56/mongo.sh index d4ebaa37e..0d48160f6 100755 --- a/plugins/php/versions/56/mongo.sh +++ b/plugins/php/versions/56/mongo.sh @@ -12,8 +12,11 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=mongo - +LIBV=1.5.0 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,32 @@ 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/mongo-1.6.16.tgz http://pecl.php.net/get/mongo-1.6.16.tgz + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz - cd $php_lib && tar xvf mongo-1.6.16.tgz - cd mongo-1.6.16 + 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 mongo-* - rm -f package.xml + rm -rf ${LIBNAME}-* fi if [ ! -f "$extFile" ];then echo "ERROR!" return fi - echo "extension=mongo.so" >> $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 '===========================================================' @@ -61,14 +66,14 @@ Uninstall_lib() 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-$vphp not install ${LIBNAME}, Plese select other version!" return fi - sed -i '_bak' '/mongo.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 +82,6 @@ Uninstall_lib() } -actionType=$1 -version=$2 if [ "$actionType" == 'install' ];then Install_lib elif [ "$actionType" == 'uninstall' ];then diff --git a/plugins/php/versions/56/opcache.sh b/plugins/php/versions/56/opcache.sh new file mode 100755 index 000000000..68f82c29a --- /dev/null +++ b/plugins/php/versions/56/opcache.sh @@ -0,0 +1,55 @@ +#!/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=opcache +LIBV=7.0.5 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so + +Install_lib() +{ + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[opcache]" >> $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 + echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini + echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini + echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini + echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini + echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +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 + + $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/redis.sh b/plugins/php/versions/56/redis.sh index fa35a72ed..13e2db89e 100755 --- a/plugins/php/versions/56/redis.sh +++ b/plugins/php/versions/56/redis.sh @@ -12,8 +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-20131226/ Install_lib() { @@ -23,30 +27,33 @@ Install_lib() return fi - extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so + extFile=$extDir${LIBNAME}.so if [ ! -f "$extFile" ];then php_lib=$sourcePath/php_${version}_lib mkdir -p $php_lib - 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 '===========================================================' @@ -61,14 +68,15 @@ Uninstall_lib() return fi - extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so + 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' '/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 @@ -77,8 +85,7 @@ Uninstall_lib() } -actionType=$1 -version=$2 + if [ "$actionType" == 'install' ];then Install_lib elif [ "$actionType" == 'uninstall' ];then diff --git a/plugins/php/versions/56/xdebug.sh b/plugins/php/versions/56/xdebug.sh new file mode 100755 index 000000000..446b76012 --- /dev/null +++ b/plugins/php/versions/56/xdebug.sh @@ -0,0 +1,89 @@ +#!/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-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 + 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/70/redis.sh b/plugins/php/versions/70/redis.sh index 47544c9f8..ae44d9686 100755 --- a/plugins/php/versions/70/redis.sh +++ b/plugins/php/versions/70/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,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 '===========================================================' @@ -62,18 +64,19 @@ Install_lib() Uninstall_lib() { if [ ! -f "$serverPath/php/$version/bin/php-config" ];then - echo "php$version 未安装,请选择其它版本!" + 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!" + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$version not install memcache, Plese select other version!" 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/73/redis.sh b/plugins/php/versions/73/redis.sh index f2da20a92..8f54bac3e 100755 --- a/plugins/php/versions/73/redis.sh +++ b/plugins/php/versions/73/redis.sh @@ -68,8 +68,8 @@ 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-$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$version not install memcache, Plese select other version!" return fi diff --git a/plugins/php/versions/73/yaf.sh b/plugins/php/versions/73/yaf.sh index 945e30962..c2261ab9d 100755 --- a/plugins/php/versions/73/yaf.sh +++ b/plugins/php/versions/73/yaf.sh @@ -68,12 +68,12 @@ 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 未安装yaf,请选择其它版本!" + echo "php-$version 未安装yaf,请选择其它版本!" return fi