mirror of
https://github.com/akatsukiro/lsky-pro-install-script.git
synced 2025-06-08 05:53:04 +08:00
fix: RHEL系PHP模组安装与环境配置
This commit is contained in:
parent
521ec6ea0b
commit
061e09a7d6
23
install.sh
23
install.sh
@ -101,20 +101,29 @@ install_php() {
|
|||||||
if [[ $systemFlag == "1" ]]; then
|
if [[ $systemFlag == "1" ]]; then
|
||||||
wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg
|
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
|
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
|
elif [[ $systemFlag == "2" ]]; then
|
||||||
add-apt-repository ppa:ondrej/php
|
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
|
elif [[ $systemFlag == "3" ]]; then
|
||||||
dnf install https://rpms.remirepo.net/enterprise/remi-release-${os_version}.rpm -y
|
dnf install https://rpms.remirepo.net/enterprise/remi-release-${os_version}.rpm -y
|
||||||
dnf module reset php -y
|
dnf module reset php -y
|
||||||
dnf module install php:remi-8.1 -y
|
dnf module install php:remi-8.1 -y
|
||||||
fi
|
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
|
if [[ $systemFlag == "1" ]] || [[ $systemFlag == "2" ]]; then
|
||||||
sed -i 's/post_max_size = 8M/post_max_size = 10M/' /etc/php/8.1/fpm/php.ini
|
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
|
||||||
# 关闭open_basedir
|
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/8.1/fpm/php.ini
|
||||||
sed -i 's/;open_basedir =/open_basedir =/g' /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
|
||||||
|
# 关闭open_basedir
|
||||||
|
sed -i 's/;open_basedir =/open_basedir =/g' /etc/php/8.1/fpm/php.ini
|
||||||
|
elif [[ $systemFlag == "3" ]]; then
|
||||||
|
dnf install php php-{cli,fpm,mbstring,mysqlnd,bcmath,xml,xmlrpc,imagick,curl,gmp,imap,opcache,mailparse,soap,gd,zip} -y
|
||||||
|
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php.ini
|
||||||
|
sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/' /etc/php.ini
|
||||||
|
sed -i 's/post_max_size = 8M/post_max_size = 10M/' /etc/php.ini
|
||||||
|
# 关闭open_basedir
|
||||||
|
sed -i 's/;open_basedir =/open_basedir =/g' /etc/php.ini
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install_apache() {
|
install_apache() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user