Recently I updated CiviCRM to version 5.10.4 and while I was at it updated Drupal to 7.64 (using drush). Everything appeared fine. Then I noticed in the CiviCRM System Status report that PHP 7.1 which I had been using was no longer recommended and that I should upgrade PHP to 7.2. When I did that, the CiviCRM System Status reported "PHP Missing Extension 'mcrypt'". Not knowing that mcrypt could reek havoc on my server, I dutifully went to add it. Long story shortened, right now I'm feeling very confused and SMTP isn't working either in Drupal (not a big deal since I only use Drupal as a platform for CiviCRM) or in CiviCRM (a very big deal). Just to be clear, everything was working fine before I did the upgrades.
My inclination is to nuke PHP and reinstall it. I'm seeking advice as to whether this could work, or is there an easier way to solve my problem. I'm running Ubuntu Server 18.04. If I tried something like:
apt purge ^php*
Would that completely remove PHP from my system? A bit of background that may be relevant, when I first set up the server (apache2) I had installed three versions of PHP, 7.1, 7.2, and 7.3. I'm pretty sure that somewhere I've missed some configuration files and that some of my problems come from version issues. When I went to do a PECL install of mcrypt it successfully created the module but PHP complained that it was compiled against a different API.