From 3ee88ddfb420e1abff094febfb054239fe456e25 Mon Sep 17 00:00:00 2001 From: dami Date: Sun, 14 Sep 2025 16:01:47 +0800 Subject: [PATCH] Update install.sh --- plugins/php/versions/72/install.sh | 52 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index e2fb4ed75..5b32cf2a9 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -10,6 +10,46 @@ sourcePath=${serverPath}/source sysName=`uname` SYS_ARCH=`arch` +echo "use system: ${sysName}" +if [ ${sysName} == "Darwin" ]; then + OSNAME='macos' +elif grep -Eq "openSUSE" /etc/*-release; then + OSNAME='opensuse' + zypper refresh +elif grep -Eq "FreeBSD" /etc/*-release; then + OSNAME='freebsd' + pkg install -y wget unzip +elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then + OSNAME='arch' + echo y | pacman -Sy unzip +elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='centos' + yum install -y wget zip unzip +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='fedora' + yum install -y wget zip unzip +elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then + OSNAME='rocky' + yum install -y wget zip unzip +elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then + OSNAME='alma' + yum install -y wget zip unzip +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='debian' + apt update -y + apt install -y devscripts + apt install -y wget zip unzip +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='ubuntu' + apt install -y wget zip unzip +else + OSNAME='unknow' +fi + +VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + + + version=7.2.31 PHP_VER=72 md5_file_ok=968adcb8d0c5652b6e191b025fc8ba41 @@ -95,10 +135,18 @@ fi # ----- cpu end ------ -if [ "${SYS_ARCH}" == "arm64" ];then - # 修复arm64架构下安装 +RELOAD_CODE(){ cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c echo "cat ${curPath}/versions/${PHP_VER}/src/reentrancy.c > $sourcePath/php/php${PHP_VER}/main/reentrancy.c" +} + +if [ "${SYS_ARCH}" == "arm64" ];then + # 修复arm64架构下安装 + RELOAD_CODE +fi + +if [ "${OSNAME}" == "debian" ] && [ "${VERSION_ID}" == "13" ];then + RELOAD_CODE fi if [ "$sysName" == "Darwin" ];then