Skip to content

Instantly share code, notes, and snippets.

@wimarbueno
Forked from aurelioluiz/mamp-php-gmp.md
Created February 24, 2021 14:40
Show Gist options
  • Save wimarbueno/026c7ba9c88f0cc0a132f5d3aba03958 to your computer and use it in GitHub Desktop.
Save wimarbueno/026c7ba9c88f0cc0a132f5d3aba03958 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

@rasmuscnielsen
Copy link

Awesome man, thanks! brew install autoconf gmp was what I needed ;-)

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