I was moving some sites from a server to a new one. A few sites would not work after moving them. One of them said "MySQL not supported by your PHP version". After searching, it seems to be caused by deprecated mysql extension. So I thought changing php version to same as old server would resolve this - old server php version is 5.4.45
I tried following some answers to similar questions but nothing worked. I did this one but since mysql is already deprecated in php5.6, this wouldn't fix my problem: How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?
Tried these ones also: How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release?
How to downgrade PHP from 5.5.9 to 5.4 in Ubuntu 14.04 (Installed with LAMP)
I guess that since these questions are a few years old already, resources might not be available anymore.
Can anyone tell me a way to install php 5.4 that will work in present time?
Additional info: - ubuntu 16.04