mirror of https://github.com/midoks/mdserver-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
3 years ago
|
#!/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")
|
||
|
serverPath=$(dirname "$rootPath")
|
||
|
sourcePath=${serverPath}/source
|
||
|
sysName=`uname`
|
||
|
install_tmp=${rootPath}/tmp/mw_install.pl
|
||
|
|
||
|
|
||
|
#获取信息和版本
|
||
|
# bash /www/server/mdsever-web/scripts/getos.sh
|
||
|
bash ${rootPath}/scripts/getos.sh
|
||
|
OSNAME=`cat ${rootPath}/data/osname.pl`
|
||
|
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||
|
|
||
|
version=8.1.x
|
||
|
PHP_VER=81
|
||
|
|
||
|
|
||
|
Install_php()
|
||
|
{
|
||
|
#------------------------ install start ------------------------------------#
|
||
|
|
||
|
### centos start ################
|
||
|
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-${VERSION_ID}.rpm
|
||
|
yum install -y php81 php81-php-fpm
|
||
|
### centos start ################
|
||
|
|
||
|
if [ "$?" == "0" ];then
|
||
|
mkdir -p $serverPath/php-yum/${PHP_VER}
|
||
|
fi
|
||
|
|
||
|
#------------------------ install end ------------------------------------#
|
||
|
}
|
||
|
|
||
|
Uninstall_php()
|
||
|
{
|
||
|
# $serverPath/php-ya/init.d/php${PHP_VER} stop
|
||
|
rm -rf $serverPath/php-yum/${PHP_VER}
|
||
|
echo "卸载php-${version}..." > $install_tmp
|
||
|
}
|
||
|
|
||
|
action=${1}
|
||
|
if [ "${1}" == 'install' ];then
|
||
|
Install_php
|
||
|
else
|
||
|
Uninstall_php
|
||
|
fi
|