This commit is contained in:
Mr Chen
2019-03-11 13:43:04 +08:00
parent 608a78ac67
commit 4651bf782c
41 changed files with 1974 additions and 267 deletions
+1
View File
@@ -60,6 +60,7 @@ cd $sourcePath/php/php-5.3.29 && ./configure \
--enable-mbstring \
--enable-sysvshm \
--enable-sysvmsg \
--enable-intl \
--enable-exif \
--enable-ftp \
--enable-wddx \
+21 -17
View File
@@ -13,30 +13,33 @@ sourcePath=${serverPath}/source/php
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/swoole.so
LIBNAME=swoole
LIBV='1.10.1';
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then
LIBV='2.2.0'
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep 'swoole.so'`
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep '${LIBNAME}.so'`
if [ "${isInstall}" != "" ];then
echo "php-$version 已安装yaf,请选择其它版本!"
echo "php-$version 已安装${LIBNAME},请选择其它版本!"
return
fi
if [ ! -f "$extFile" ];then
wafV='1.10.1';
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then
wafV='2.2.0';
fi
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
wget -O $php_lib/swoole-$wafV.tgz http://pecl.php.net/get/swoole-$wafV.tgz
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
cd $php_lib
tar xvf swoole-$wafV.tgz
cd swoole-$wafV
tar xvf ${LIBNAME}-${LIBV}.tgz
cd ${LIBNAME}-${LIBV}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
@@ -60,8 +63,9 @@ Install_lib()
fi
done
echo "extension=$extFile"
echo "extension=$extFile" >> $serverPath/php/$version/etc/php.ini
echo "" >> $serverPath/php/$version/etc/php.ini
echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini
echo "extension=${LIBNAME}" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
@@ -72,18 +76,18 @@ Install_lib()
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
echo "php-$version 未安装,请选择其它版本!"
return
fi
if [ ! -f "$extFile" ];then
echo "php$version 未安装swoole,请选择其它版本!"
echo "php-$version 未安装${LIBNAME},请选择其它版本!"
return
fi
echo $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/swoole.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
rm -f $extFile
$serverPath/php/init.d/php$version reload