If you are using CloudLinux and PHP selector, sometimes you will get following error after changing native PHP to other versions.
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
You can fix this by the following command.
# cagefsctl –setup-cl-selector
# cagefsctl –remount-all