Introduction
In some cases, you'll want to install PHP extensions for all of your PHP versions. To do this, you would need to run the installer for each individual version.
Procedure
In the following article, we explain how to run the installer: How to install PHP extensions using PECL
But you could run the installer for several versions of PHP by looping through each version with a command such as the following where we loop through versions 72 through 80 to install xmldiff as an example:
ls /opt/cpanel/ea-php{72..80}/root/usr/bin/pecl 2>/dev/null | while read phpversion; do $phpversion install xmldiff; done