This commit is contained in:
dami
2025-07-20 11:20:11 +08:00
parent 88be69ffc7
commit 574b87f5b5
2 changed files with 48 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
"name": "php-apt",
"title": "PHP[APT]",
"coexist": true,
"versions": ["56","70","71","72","73","74","80","81","82","83","84"],
"versions": ["56","70","71","72","73","74","80","81","82","83","84", "85"],
"install_pre_inspection":true,
"tip": "soft",
"checks": "server/php-apt/VERSION",
+47
View File
@@ -0,0 +1,47 @@
#!/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=8.5
PHP_VER=85
Install_php()
{
#------------------------ install start ------------------------------------#
apt -y install php${version} php${version}-fpm php${version}-dev
if [ "$?" == "0" ];then
mkdir -p $serverPath/php-apt/${PHP_VER}
fi
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
#------------------------ uninstall start ------------------------------------#
apt -y remove php${version} php${version}-*
rm -rf $serverPath/php-apt/${PHP_VER}
echo "卸载php-${version}..."
#------------------------ uninstall start ------------------------------------#
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi