mirror of https://github.com/midoks/mdserver-web
parent
d12a550e58
commit
b35ebe6db8
@ -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=memcached |
||||
LIBV=3.1.3 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20151012/${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 |
@ -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-20151012/${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 |
@ -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 |
||||
|
||||
|
||||
LIBNAME=swoole |
||||
LIBV=4.3.0 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20151012/${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-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 "" >> $serverPath/php/$version/etc/php.ini |
||||
echo "[${LIBNAME}]" >> $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},请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
echo $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 '===============================================' |
||||
echo 'successful!' |
||||
} |
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then |
||||
Install_lib |
||||
elif [ "$actionType" == 'uninstall' ];then |
||||
Uninstall_lib |
||||
fi |
@ -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.7.0 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20151012/${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 |
@ -0,0 +1,94 @@ |
||||
#!/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 |
||||
|
||||
LIBNAME=yac |
||||
LIBV=2.0.2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20151012/${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 .. |
||||
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 "${LIBNAME}.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' "/${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 |
@ -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 |
||||
|
||||
|
||||
|
||||
actionType=$1 |
||||
version=$2 |
||||
|
||||
LIBNAME=yaf |
||||
LIBV='2.3.5' |
||||
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then |
||||
LIBV='3.0.7'; |
||||
fi |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20151012/${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 .. |
||||
rm -rf ${LIBNAME}-* |
||||
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 "${LIBNAME}.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 未安装${LIBNAME},请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
echo $serverPath/php/$version/etc/php.ini |
||||
sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini |
||||
sed -i '_bak' "/${LIBNAME}.use_namespace/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 |
@ -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=memcached |
||||
LIBV=3.1.3 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${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 |
@ -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-20160303/${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 |
@ -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 |
||||
|
||||
|
||||
LIBNAME=swoole |
||||
LIBV=4.3.0 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${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-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 "" >> $serverPath/php/$version/etc/php.ini |
||||
echo "[${LIBNAME}]" >> $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},请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
echo $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 '===============================================' |
||||
echo 'successful!' |
||||
} |
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then |
||||
Install_lib |
||||
elif [ "$actionType" == 'uninstall' ];then |
||||
Uninstall_lib |
||||
fi |
@ -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.7.0 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${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 |
@ -0,0 +1,94 @@ |
||||
#!/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 |
||||
|
||||
LIBNAME=yac |
||||
LIBV=2.0.2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${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 .. |
||||
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 "${LIBNAME}.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' "/${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 |
@ -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=memcached |
||||
LIBV=3.1.3 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${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 |
@ -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-20170718/${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 |
@ -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 |
||||
|
||||
|
||||
LIBNAME=swoole |
||||
LIBV=4.3.0 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${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-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 "" >> $serverPath/php/$version/etc/php.ini |
||||
echo "[${LIBNAME}]" >> $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},请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
echo $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 '===============================================' |
||||
echo 'successful!' |
||||
} |
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then |
||||
Install_lib |
||||
elif [ "$actionType" == 'uninstall' ];then |
||||
Uninstall_lib |
||||
fi |
@ -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.7.0 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${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 |
@ -0,0 +1,94 @@ |
||||
#!/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 |
||||
|
||||
LIBNAME=yac |
||||
LIBV=2.0.2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${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 .. |
||||
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 "${LIBNAME}.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' "/${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 |
@ -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=memcached |
||||
LIBV=3.1.3 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20180731/${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 |
@ -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-20180731/${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 |
@ -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 |
||||
|
||||
|
||||
LIBNAME=swoole |
||||
LIBV=4.3.0 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20180731/${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-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 "" >> $serverPath/php/$version/etc/php.ini |
||||
echo "[${LIBNAME}]" >> $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},请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
echo $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 '===============================================' |
||||
echo 'successful!' |
||||
} |
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then |
||||
Install_lib |
||||
elif [ "$actionType" == 'uninstall' ];then |
||||
Uninstall_lib |
||||
fi |
@ -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.7.0 |
||||
sysName=`uname` |
||||
actionType=$1 |
||||
version=$2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20180731/${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 |
@ -0,0 +1,94 @@ |
||||
#!/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 |
||||
|
||||
LIBNAME=yac |
||||
LIBV=2.0.2 |
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20180731/${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 .. |
||||
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 "${LIBNAME}.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' "/${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 |
@ -1,131 +0,0 @@ |
||||
#!/bin/bash |
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin |
||||
export PATH |
||||
|
||||
# /bin/bash apc.sh uninstall 53 |
||||
|
||||
curPath=`pwd` |
||||
|
||||
rootPath=$(dirname "$curPath") |
||||
rootPath=$(dirname "$rootPath") |
||||
rootPath=$(dirname "$rootPath") |
||||
rootPath=$(dirname "$rootPath") |
||||
serverPath=$(dirname "$rootPath") |
||||
echo $serverPath |
||||
Install_yaf() |
||||
{ |
||||
case "${version}" in |
||||
'54') |
||||
extFile='/www/server/php/54/lib/php/extensions/no-debug-non-zts-20100525/yaf.so' |
||||
;; |
||||
'55') |
||||
extFile='/www/server/php/55/lib/php/extensions/no-debug-non-zts-20121212/yaf.so' |
||||
;; |
||||
'56') |
||||
extFile='/www/server/php/56/lib/php/extensions/no-debug-non-zts-20131226/yaf.so' |
||||
;; |
||||
'70') |
||||
extFile='/www/server/php/70/lib/php/extensions/no-debug-non-zts-20151012/yaf.so' |
||||
;; |
||||
'71') |
||||
extFile='/www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/yaf.so' |
||||
;; |
||||
'71') |
||||
extFile='/www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/yaf.so' |
||||
;; |
||||
'72') |
||||
extFile='/www/server/php/72/lib/php/extensions/no-debug-non-zts-20170718/yaf.so' |
||||
;; |
||||
esac |
||||
|
||||
isInstall=`cat /www/server/php/$version/etc/php.ini|grep 'yaf.so'` |
||||
if [ "${isInstall}" != "" ];then |
||||
echo "php-$vphp 已安装yaf,请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
|
||||
if [ ! -f "$extFile" ];then |
||||
public_file=/www/server/panel/install/public.sh |
||||
if [ ! -f $public_file ];then |
||||
wget -O $public_file http://download.bt.cn/install/public.sh -T 5; |
||||
fi |
||||
. $public_file |
||||
|
||||
download_Url=$NODE_URL |
||||
|
||||
wafV='2.3.5'; |
||||
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then |
||||
wafV='3.0.7'; |
||||
fi |
||||
wget -O yaf-$wafV.tgz $download_Url/src/yaf-$wafV.tgz |
||||
tar xvf yaf-$wafV.tgz |
||||
cd yaf-$wafV |
||||
|
||||
/www/server/php/$version/bin/phpize |
||||
./configure --with-php-config=/www/server/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 "extension=$extFile" >> /www/server/php/$version/etc/php.ini |
||||
|
||||
service php-fpm-$version reload |
||||
echo '===========================================================' |
||||
echo 'successful!' |
||||
} |
||||
|
||||
|
||||
Uninstall_yaf() |
||||
{ |
||||
if [ ! -f "/www/server/php/$version/bin/php-config" ];then |
||||
echo "php-$vphp 未安装,请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
case "${version}" in |
||||
'54') |
||||
extFile='/www/server/php/54/lib/php/extensions/no-debug-non-zts-20100525/yaf.so' |
||||
;; |
||||
'55') |
||||
extFile='/www/server/php/55/lib/php/extensions/no-debug-non-zts-20121212/yaf.so' |
||||
;; |
||||
'56') |
||||
extFile='/www/server/php/56/lib/php/extensions/no-debug-non-zts-20131226/yaf.so' |
||||
;; |
||||
'70') |
||||
extFile='/www/server/php/70/lib/php/extensions/no-debug-non-zts-20151012/yaf.so' |
||||
;; |
||||
'71') |
||||
extFile='/www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/yaf.so' |
||||
;; |
||||
'72') |
||||
extFile='/www/server/php/72/lib/php/extensions/no-debug-non-zts-20170718/yaf.so' |
||||
esac |
||||
if [ ! -f "$extFile" ];then |
||||
echo "php-$vphp 未安装yaf,请选择其它版本!" |
||||
return |
||||
fi |
||||
|
||||
sed -i '/yaf.so/d' /www/server/php/$version/etc/php.ini |
||||
|
||||
rm -f $extFile |
||||
/etc/init.d/php-fpm-$version reload |
||||
echo '===============================================' |
||||
echo 'successful!' |
||||
} |
||||
|
||||
|
||||
actionType=$1 |
||||
version=$2 |
||||
if [ "$actionType" == 'install' ];then |
||||
Install_yaf |
||||
elif [ "$actionType" == 'uninstall' ];then |
||||
Uninstall_yaf |
||||
fi |
Loading…
Reference in new issue