Update php.sh

This commit is contained in:
FusionPBX 2023-06-16 16:24:15 -06:00 committed by GitHub
parent ac87158a4b
commit 10c18bb0f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -27,10 +27,10 @@ apt remove -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite
#install php update and set the unix socket #install php update and set the unix socket
if [ ."$php_version" = ."8.2" ]; then if [ ."$php_version" = ."8.2" ]; then
#add a repo for php 8.x #add a repo for php 8.x
apt -y install apt-transport-https lsb-release ca-certificates curl wget gnupg2 /usr/bin/apt -y install apt-transport-https lsb-release ca-certificates curl wget gnupg2
wget -qO- https://packages.sury.org/php/apt.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/sury-php-8.x.gpg /usr/bin/wget -qO- https://packages.sury.org/php/apt.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/sury-php-8.x.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' /usr/bin/sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get update /usr/bin/apt-get update
#install php 8.2 #install php 8.2
apt-get install -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-imap php8.2-xml php8.2-gd php8.2-mbstring php8.2-ldap apt-get install -y php8.2 php8.2-cli php8.2-dev php8.2-fpm php8.2-pgsql php8.2-sqlite3 php8.2-odbc php8.2-curl php8.2-imap php8.2-xml php8.2-gd php8.2-mbstring php8.2-ldap
@ -43,13 +43,13 @@ if [ ."$php_version" = ."8.2" ]; then
fi fi
if [ ."$php_version" = ."8.1" ]; then if [ ."$php_version" = ."8.1" ]; then
#add a repo for php 7.x #add a repo for php 7.x
apt -y install apt-transport-https lsb-release ca-certificates curl wget gnupg2 /usr/bin/apt -y install apt-transport-https lsb-release ca-certificates curl wget gnupg2
wget -qO- https://packages.sury.org/php/apt.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/sury-php-8.x.gpg /usr/bin/wget -qO- https://packages.sury.org/php/apt.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/sury-php-8.x.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' /usr/bin/sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get update /usr/bin/apt-get update
#install php 8.1 #install php 8.1
apt-get install -y php8.1 php8.1-cli php8.1-dev php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-imap php8.1-xml php8.1-gd php8.1-mbstring php8.1-ldap /usr/bin/apt-get install -y php8.1 php8.1-cli php8.1-dev php8.1-fpm php8.1-pgsql php8.1-sqlite3 php8.1-odbc php8.1-curl php8.1-imap php8.1-xml php8.1-gd php8.1-mbstring php8.1-ldap
#update the unix socket name #update the unix socket name
/usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.1-fpm.sock;#g' /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php8.1-fpm.sock;#g'
@ -59,11 +59,11 @@ if [ ."$php_version" = ."8.1" ]; then
fi fi
if [ ."$php_version" = ."7.4" ]; then if [ ."$php_version" = ."7.4" ]; then
#remove the sury PHP repo #remove the sury PHP repo
rm -f -- /etc/apt/sources.list.d/php.list /usr/bin/rm -f -- /etc/apt/sources.list.d/php.list
apt update /usr/bin/apt update
#install php 7.4 #install php 7.4
apt-get install -y php7.4 php7.4-cli php7.4-dev php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd php7.4-mbstring php7.4-ldap /usr/bin/apt-get install -y php7.4 php7.4-cli php7.4-dev php7.4-fpm php7.4-pgsql php7.4-sqlite3 php7.4-odbc php7.4-curl php7.4-imap php7.4-xml php7.4-gd php7.4-mbstring php7.4-ldap
#update the unix socket name #update the unix socket name
/usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.4-fpm.sock;#g' /usr/bin/sed -i /etc/nginx/sites-available/fusionpbx -e 's#unix:.*;#unix:/var/run/php/php7.4-fpm.sock;#g'