This commit is contained in:
midoks 2020-07-14 16:28:21 +08:00
parent 1ed436da45
commit 91c44fe110
2 changed files with 27 additions and 24 deletions

View File

@ -11,13 +11,14 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=mongodb
LIBV=1.7.5
sysName=`uname`
actionType=$1
version=$2
LIBNAME=yaf
LIBV=3.2.5
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190128/${LIBNAME}.so
sysName=`uname`
if [ "$sysName" == "Darwin" ];then
BAK='_bak'
else
@ -26,38 +27,38 @@ fi
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_lib
mkdir -p $php_lib
if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz
fi
fi
cd $php_lib/${LIBNAME}-${LIBV}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
&& make clean && make && make install && make clean
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install && make clean
fi
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
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 "" >> $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!'
@ -67,18 +68,19 @@ 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},请选择其它版本!"
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
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

View File

@ -219,7 +219,9 @@
"70",
"71",
"72",
"73"
"73",
"74",
"80"
],
"type": "框架",
"msg": "Yaf是一个C语言编写的PHP框架",
@ -264,8 +266,7 @@
"71",
"72",
"73",
"74",
"80"
"74"
],
"type": "通用扩展",
"msg": "Mongodb数据库连接驱动",