Skip to content

Instantly share code, notes, and snippets.

@aurelioluiz
Last active October 28, 2021 06:46
Show Gist options
  • Save aurelioluiz/63813b6af780725a67ba4fb535b3bed5 to your computer and use it in GitHub Desktop.
Save aurelioluiz/63813b6af780725a67ba4fb535b3bed5 to your computer and use it in GitHub Desktop.
How to install GMP extension for PHP 7.2 using MAMP

Installing GMP extension for PHP 7.2 using MAMP

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.2.10.tar.bz2/from/a/mirror

$ cd php-7.2.10/ext/gmp
$ /Applications/MAMP/bin/php/php7.2.10/bin/phpize
$ ./configure --with-php-config=/Applications/MAMP/bin/php/php7.2.10/bin/php-config
$ make
$ make install

Add the extension loading config to php.ini in /Applications/MAMP/bin/php/php7.2.10/conf and restart servers MAMP.

extension=gmp.so

Looking at the PHP information should display something like.

GMP Enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment