WordPress asks for certain PHP extensions, and a plugin that wants one tells you only after it fails. Scrolling through a full phpinfo() page for that is silly. You can ask for one extension at a time.
php --ri curl
The manual says --ri (long form --rextinfo) shows the configuration information for the given extension, the same information that phpinfo() returns. On PHP 8.3.6 the first lines for curl are:
curl
cURL support => enabled
cURL Information => 8.5.0
The core configuration is available by using main as the extension name:
php --ri main
To see which extensions exist at all, php -m lists the compiled-in modules.
It also works as a yes-or-no test in a script. For a name that isn’t loaded, PHP prints a message and exits with 1:
$ php --ri nonexistent
Extension 'nonexistent' not present.
$ echo $?
1
Caveats: the name you pass is the extension’s own name, which isn’t always the one you’d guess. On the same machine php --ri opcache answers that the extension isn’t present, while php --ri "Zend OPcache" prints its settings. When in doubt, look at the php -m list first. And as with --ini, this describes the command-line PHP, not necessarily the one your web server runs.
Further reading: PHP manual: command line options