1

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:

Andrew Newby
  • 1,041
  • 1
  • 22
  • 48
  • 1
    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`? – AlexD Dec 28 '21 at 09:38
  • 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!) – Andrew Newby Dec 28 '21 at 16:07

0 Answers0