Skip to content

Instantly share code, notes, and snippets.

@archytech99
Created May 9, 2025 07:15
Show Gist options
  • Save archytech99/32d740de50f8cf84e2e88a99b6c18ee4 to your computer and use it in GitHub Desktop.
Save archytech99/32d740de50f8cf84e2e88a99b6c18ee4 to your computer and use it in GitHub Desktop.
PHP-FPM is a FastCGI implementation specifically designed to handle high workloads and offers advanced features, including the ability to run multiple PHP versions on a single server.
#!/bin/bash
PS3='Install PHP Module Multiversi Ubuntu 22.04 Server: '
options=("PHP 5.6" "PHP 7.4" "PHP 8.0" "PHP 8.1" "PHP 8.2" "PHP 8.3" "Quit")
select opt in "${options[@]}"
do
case $opt in
"PHP 5.6")
echo "Ready PHP 5.6"
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt upgrade -y
sudo apt-get install php5.6 php5.6-{mysql,mbstring,xml,gd,curl,fpm} -y
;;
"PHP 7.4")
echo "Ready PHP 7.4"
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt upgrade -y
sudo apt-get install php7.4 php7.4-{mysql,mbstring,xml,gd,curl,fpm} -y
;;
"PHP 8.0")
echo "Ready Install PHP 8.0"
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt upgrade -y
sudo apt-get install php8.0 php8.0-{mysql,mbstring,xml,gd,curl,fpm} -y
;;
"PHP 8.1")
echo "Ready Install PHP 8.1"
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt upgrade -y
sudo apt-get install php8.1 php8.1{mysql,mbstring,xml,gd,curl,fpm} -y
;;
"PHP 8.2")
echo "Ready Install PHP 8.2"
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt upgrade -y
sudo apt-get install php8.2 php8.2-{mysql,mbstring,xml,gd,curl,fpm} -y
;;
"PHP 8.3")
echo "Ready Install PHP 8.3"
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt upgrade -y
sudo apt-get install php8.3 php8.3-{mysql,mbstring,xml,gd,curl,fpm} -y
;;
"Quit")
break
;;
*) echo "invalid option $REPLY";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment