When you install a new version of PHP, it's helpful to also reinstall all of the associated modules. I generally just make it easy for myself and use something like:
sudo yum install php php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap,gmp,redis} -y
(Note: I'm using a vanilla OS without a control panel on an Amazon Linux 2 instance which is like Fedora or Centos) The exact steps would vary depending on your OS, any control panel you use, etc)