You have to build the GMP extension from the PHP source code. First install Autoconf and GMP using Homebrew.
brew install autoconf gmp
Download and unpack PHP.
http://php.net/get/php-7.4.2.tar.bz2/from/a/mirror
$ cd php-7.4.2/ext/gmp
$ /Applications/MAMP/bin/php/php7.4.2/bin/phpize
$ ./configure --with-php-config=/Applications/MAMP/bin/php/php7.4.2/bin/php-config
$ make
$ make install
Add the extension loading config to php.ini
in /Applications/MAMP/bin/php/php7.4.2/conf
.
extension=gmp.so
Restart MAMP servers and verify extension is loaded in the phpinfo()
report.
it works, thanks bro