بسم الله
Bismillah
Easy command how to change php version, because old project using old version php.
Suggested solution
Add repository sourcelist for php5x with command
sudo add-apt-repository ppa:ondrej/php
If our ubuntu not automatic Update, run manual update
sudo apt update
Install php 5 then install php 7
sudo install php5.6 && sudo install php7.2
After the installation is complete, check the default php used
sudo update-alternative --config php
Or
php -v
You can change the version as you needed
how to enable php 5 ?
sudo a2dismod php7.2
sudo a2enmod php5.6
how to enable php 7
sudo a2dismod php5.6
sudo a2enmod php7.2
الحمد لله