get the list of php versions installed
I use the following command to view installed PHP versions in Ubuntu: ======================================================================== sudo update-alternatives --list php
Source: stackoverflow.com
list all php version
sudo update-alternatives --config php