If you have multiple versions of PHP installed on your system you sometimes need to switch between which version you're using as the default. Normally web servers are configured to work with specific PHP versions but when you run PHP on the command line, the default will be set to whatever version you most recently installed. This command lets you change which version of PHP you use as the default on the command line:
sudo update-alternatives --config php