A PHP installer redirected the /usr/bin/php
link to a PHP version incompatible with the installed PECL version.
I checked it with the commands:
php -v
which php
readlink -f /usr/bin/php
So, to fix the problem, I reverted the /usr/bin/php` link to the proper PHP version:
rm -f /usr/bin/php
ln -s /usr/bin/php7.4 /usr/bin/php