Score:0

Composer telling me " PHP extension ext-gmp * but it is missing" when it shouldn't be

in flag

I'm new to Composer, so be gentle!

I'm trying to install a script that uses Composer, but I get:

  Problem 1
    - Root composer.json requires PHP extension ext-gmp * but it is missing from your system. Install or enable PHP's gmp extension.

After researching, I've found you have to install GMP, so I did:

sudo apt-get install php7.4-gmp

That installed fine. Then I both:

/etc/php/7.4/cli/php.ini
/etc/php/7.4/fpm/php.ini

..and added in:

extension=gmp.so

Yet when I run the script again, I still get that error message!

From the frontend with <? ech phpinfo() ?> I get it fine: (but I'm aware CLI and front-end PHP-FPM stuff runs under different configs);

enter image description here

What am I missing? Its driving me nuts! I'm also getting errors about the PHP version:

jp flag
do you have multiple PHP versions installed on the system? Is it possible that your `composer` is using a different version other than `php-7.4`?
Andrew Newby avatar
in flag
Thanks - that was it! I found this command: `composer config platform.php 7.4`, and now the message has gone away :) I guess it was trying to use the latest version of PHP (we have 7.1, 7.2, 7.3, 7.5, 8.0 and 8.1!)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.