Well, technically you should be using dnf (dandified yum) with 8.x, but yum still works, so whatever.
You can just do a
Code:
dnf remove php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring
, dnf (and yum that preceeded it) automatically removes any orphans that were pulled in for a package that has been removed.