This is worth documenting!
You can add new PHP extensions for all installed PHP versions on the system by running the following command on Debian and derivatives:
for php in $(ls /etc/php); do sudo apt-get install -y "php$php-"{curl,intl}; done
For RHEL and derivatives you could use the following instead:
for php in $(scl list-collections 2>/dev/null | grep 'php' | sed 's/$/-php/') php; do for ext in curl intl; do sudo dnf -y install "${php}-${ext}"; done; done
A command above install curl
and intl
extensions for all PHP version that were installed on the system, similar to what Virtualmin is doing upon script installation. You can replace the names of the extensions with the ones you need to have installed.
I will add this to the new documentation website.