Check PHP extensions requirement with composer

Check PHP extensions requirement with composer

When configuring your server, you need to know which PHP extensions need to be installed and updated. But through changing dependencies it's possible that you don't need certain extensions any more. Or you've included a new dependency which needs a new extension.

Previously much work to validate what you need, now you can simply ask composer for all requirements which include the extensions with the following command:

composer check-platform-reqs

Which will result in something like:

Checking platform requirements for packages in the vendor dir
composer-plugin-api   2.0.0       success
composer-runtime-api  2.0.0       success
ext-ctype             8.0.2       success
ext-dom               20031129    success
ext-filter            8.0.2       success
ext-hash              8.0.2       success
ext-iconv             8.0.2       success
ext-intl              8.0.2       success
ext-json              8.0.2       success
ext-libxml            8.0.2       success
ext-mbstring          8.0.2       success
ext-openssl           8.0.2       success
ext-pcre              8.0.2       success
ext-pdo               8.0.2       success
ext-pgsql             8.0.2       success
ext-phar              8.0.2       success
ext-reflection        8.0.2       success
ext-simplexml         8.0.2       success
ext-sodium            8.0.2       success
ext-spl               8.0.2       success
ext-tokenizer         8.0.2       success
ext-xml               8.0.2       success
ext-xmlwriter         8.0.2       success
php                   8.0.2       success