This commit is contained in:
midoks
2020-07-14 16:28:21 +08:00
parent 566c6d3b24
commit 02e8c98de0
2 changed files with 27 additions and 24 deletions
@@ -11,13 +11,14 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php sourcePath=${serverPath}/source/php
LIBNAME=mongodb
LIBV=1.7.5
sysName=`uname`
actionType=$1 actionType=$1
version=$2 version=$2
LIBNAME=yaf
LIBV=3.2.5
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190128/${LIBNAME}.so extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190128/${LIBNAME}.so
sysName=`uname`
if [ "$sysName" == "Darwin" ];then if [ "$sysName" == "Darwin" ];then
BAK='_bak' BAK='_bak'
else else
@@ -26,38 +27,38 @@ fi
Install_lib() Install_lib()
{ {
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then if [ "${isInstall}" != "" ];then
echo "php-$version 已安装${LIBNAME},请选择其它版本!" echo "php-$version 已安装${LIBNAME},请选择其它版本!"
return return
fi fi
if [ ! -f "$extFile" ];then if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_lib php_lib=$sourcePath/php_lib
mkdir -p $php_lib mkdir -p $php_lib
if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz
fi fi
cd $php_lib/${LIBNAME}-${LIBV} cd $php_lib/${LIBNAME}-${LIBV}
$serverPath/php/$version/bin/phpize $serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \ ./configure --with-php-config=$serverPath/php/$version/bin/php-config
&& make clean && make && make install && make clean make && make install && make clean
fi fi
if [ ! -f "$extFile" ];then if [ ! -f "$extFile" ];then
echo "ERROR!" echo "ERROR!"
return return;
fi fi
echo "" >> $serverPath/php/$version/etc/php.ini echo "" >> $serverPath/php/$version/etc/php.ini
echo "[${LIBNAME}]" >> $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 "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 $serverPath/php/init.d/php$version reload
echo '===========================================================' echo '==========================================================='
echo 'successful!' echo 'successful!'
@@ -67,18 +68,19 @@ Install_lib()
Uninstall_lib() Uninstall_lib()
{ {
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!" echo "php-$version 未安装,请选择其它版本!"
return return
fi fi
if [ ! -f "$extFile" ];then if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!" echo "php-$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
return return
fi fi
echo $serverPath/php/$version/etc/php.ini
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 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 rm -f $extFile
$serverPath/php/init.d/php$version reload $serverPath/php/init.d/php$version reload
+4 -3
View File
@@ -219,7 +219,9 @@
"70", "70",
"71", "71",
"72", "72",
"73" "73",
"74",
"80"
], ],
"type": "框架", "type": "框架",
"msg": "Yaf是一个C语言编写的PHP框架", "msg": "Yaf是一个C语言编写的PHP框架",
@@ -264,8 +266,7 @@
"71", "71",
"72", "72",
"73", "73",
"74", "74"
"80"
], ],
"type": "通用扩展", "type": "通用扩展",
"msg": "Mongodb数据库连接驱动", "msg": "Mongodb数据库连接驱动",