Using OS X 10.11.1 (El Capitan) and PHP 5.5.29.
I would like to add the GMP extension to my PHP, but I have no clue to do so. According to the PHP manual I'm supposed compile PHP with a --with-gmp=dir
option. But I don't know how to compile PHP (I doubt if I ever did it on this machine, iirc it just came with PHP by default), and I don't know what dir to use with that --with-gmp=
option either.
I do have Homebrew, and I noticed a rather old old similar question however that doesn't seem to work (package no longer available).
I noticed in brew there is something called homebrew/php/php55-gmp
but that suggests to something with brew tap
. I have no clue what that is, and I'd rather not mess up my Homebrew config or my entire development environment (I guess that's unlikely, but I have no idea what I'm doing to my system when I mess with this tap stuff).
GMP module is by default added to PHP. You can activate the same by removing the (;) ;extension=gmp added at the start of the extension in php. ini.
Name : php-gmp Arch : x86_64 Version : 7.2. 11 Summary : A module for PHP applications for using the GNU MP library Description : These functions allow you to work with arbitrary-length integers using the GNU MP library.
PHP is bundled with macOS since macOS X (10.0. 0) prior to macOS Monterey (12.0. 0). Compiling is similar to the Unix installation guide.
RocketNuts, you can simply execute:
brew install homebrew/php/php55-gmp
That's all what I did.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With