Simple Linux Panel
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.
mdserver-web/plugins/php-apt/versions/72/install.sh

52 lines
1.3 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`
#获取信息和版本
# 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=7.2
PHP_VER=72
3 years ago
# apt -y install php7.2 php7.2-fpm php7.2-dev
3 years ago
Install_php()
{
#------------------------ install start ------------------------------------#
3 years ago
apt -y install php${version} php${version}-fpm php${version}-dev
3 years ago
if [ "$?" == "0" ];then
mkdir -p $serverPath/php-apt/${PHP_VER}
fi
#------------------------ install end ------------------------------------#
}
3 years ago
# systemctl status php7.2-fpm
# apt -y remove php7.2 php7.2-fpm php7.2-dev
3 years ago
Uninstall_php()
{
#------------------------ uninstall start ------------------------------------#
3 years ago
apt -y remove php${version} php${version}-*
3 years ago
rm -rf $serverPath/php-apt/${PHP_VER}
11 months ago
echo "卸载php-${version}..."
3 years ago
#------------------------ uninstall start ------------------------------------#
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi