Skip to content

Instantly share code, notes, and snippets.

@JFOC
Forked from aurelioluiz/mamp-php-gmp.md
Created October 28, 2021 06:46
Show Gist options
  • Save JFOC/3f7a75511f1e04dca07a09c87cd7ede2 to your computer and use it in GitHub Desktop.
Save JFOC/3f7a75511f1e04dca07a09c87cd7ede2 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