sudo dpkg -l | grep php | tee packages.txt
sudo apt install apt-transport-https lsb-release ca-certificates wget -y
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
# Expand the curly braces with all extensions necessary.
sudo apt install php8.2 php8.2-cli php8.2-{bz2,curl,mbstring,intl}
sudo apt install php8.2-fpm
# OR
# sudo apt install libapache2-mod-php8.2
sudo a2enconf php8.2-fpm
# When upgrading from older PHP version:
sudo a2disconf php8.1-fpm
## Remove old packages
sudo apt purge php8.1*
sudo apt-get install default-mysql-server
CREATE USER 'avi'@'localhost' IDENTIFIED BY 'avi123';
GRANT ALL PRIVILEGES ON *.* TO 'avi'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'avi'@'%' IDENTIFIED BY 'avi123' WITH GRANT OPTION;