- In some case if you want to install PHP5.6 on Ubuntu 24, it's could be done with below CLI:
sudo apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:deadsnakes/ppa
sudo add-apt-repository ppa:ondrej/apache2
apt-get update && apt-get full-upgrade -y && apt-get autoremove -y && sudo apt-get clean -y
sudo apt-get install software-properties-common && sudo apt-get install php5.6 -y
apt install php5.6-{common,cgi,curl,mbstring,gd,mysqlnd,gettext,bcmath,xml,fpm,intl,zip,imap,opcache,memcache,redis,gmp,bcmath,pdo} -y
sudo a2enmod rewrite
systemctl restart apache2