Install PHP5 on Ubuntu 18.04
It is not recommended to continue PHP 5.6, which is EOL Since January 2010!
But you can install PHP5.6 from a PPA:
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt install php5.6
source: https://askubuntu.com/a/762161/34298
You may want to consider running your PHP 5 tool in a container, e.g. Docker. PHP 5 is nearing End-of-life and if you use PHP 7 on the same machine you may run in to conflicts.
There are several official Docker images available for PHP 5: https://hub.docker.com/_/php/