From 34c1e8f36ca4d47c45d4baf47bdd6e0e6f20ec8a Mon Sep 17 00:00:00 2001 From: Akatsukiro Date: Thu, 18 Jan 2024 17:06:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=89=E8=A3=85PHP=E9=83=A8=E5=88=86?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96Ubuntu=E4=B8=8A=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=96=B9=E5=BC=8F=E3=80=81=E6=96=B0=E5=A2=9ERHEL?= =?UTF-8?q?=E7=B3=BB=E5=AE=89=E8=A3=85=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 75464eb..3fe35fe 100644 --- a/install.sh +++ b/install.sh @@ -96,9 +96,18 @@ install_php() { echo -e "${green}开始安装PHP${plain}" echo "默认安装php8.1" # add repo - wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg - echo "deb [signed-by=/usr/share/keyrings/php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list - apt update && apt install php8.1 php8.1-{cli,fpm,mbstring,mysql,bcmath,xml,xmlrpc,imagick,curl,gmp,imap,opcache,mailparse,soap,gd,zip} -y + if [[ $systemFlag == "1" ]]; then + wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg + echo "deb [signed-by=/usr/share/keyrings/php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list + apt update && apt install php8.1 php8.1-{cli,fpm,mbstring,mysql,bcmath,xml,xmlrpc,imagick,curl,gmp,imap,opcache,mailparse,soap,gd,zip} -y + elif [[ $systemFlag == "2" ]]; then + add-apt-repository ppa:ondrej/php + apt update && apt install php8.1 php8.1-{cli,fpm,mbstring,mysql,bcmath,xml,xmlrpc,imagick,curl,gmp,imap,opcache,mailparse,soap,gd,zip} -y + elif [[ $systemFlag == "3" ]]; then + dnf install https://rpms.remirepo.net/enterprise/remi-release-${os_version}.rpm -y + dnf module reset php -y + dnf module install php:remi-8.1 -y + fi sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/8.1/fpm/php.ini sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/' /etc/php/8.1/fpm/php.ini sed -i 's/post_max_size = 8M/post_max_size = 10M/' /etc/php/8.1/fpm/php.ini