5

I want to enable my php-gmp and I don't want to use macports because I use homebrew.

First I

brew install gmp

and I got gmp 5.0.1

Then I downloaded the PHP source 5.3.6, then I go to

source/ext/gmp

I did

phpize

and then

MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config; make -j6;sudo make install

And it gave me this message:

checking for GNU MP support... yes, shared checking for __gmp_randinit_lc_2exp_size in -lgmp... no checking for gmp_randinit_lc_2exp_size in -lgmp... no configure: error: GNU MP Library version 4.1.2 or greater required. make: * No targets specified and no makefile found. Stop.

Any idea how to enable php-gmp without macports on Mac OSX 10.6.6? Thx

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
hSATAC
  • 301
  • 3
  • 8

2 Answers2

5

If you have the homebrew-php tap installed, you can now do:

$ brew install php55 --with-gmp
Potherca
  • 13,207
  • 5
  • 76
  • 94
Vitaly Chirkov
  • 1,692
  • 3
  • 17
  • 33
  • 1
    Error: No available formula for php55 – Tyguy7 Dec 30 '14 at 19:32
  • 2
    I've done `brew install php56 --with-gmp --with-fpm --with-homebrew-curl --with-homebrew-openssl` but I see in `php -i` output: `--without-gmp`. Really makes me sad after waiting for compilation of all this stuff :( I've had to run `brew install php56-gmp` to install GMP module separately. – Aldekein Jan 08 '16 at 11:04
1

Php-gmp is incompatible with GMP 5.0.1. This is a known bug, reported on bugs.php.net over a year ago. Check the comments on the bug to see if there's a workaround that works for you. If not, and if homebrew doesn't have a GMP 4.x package you can install instead, I think you're stuck building a copy of GMP 4.x manually. :-(

Sherm Pendley
  • 13,556
  • 3
  • 45
  • 57
  • Thx I already downloaded and built gmp 4.3.2, Im trying to recompile php with gmp...dunno how. – hSATAC Apr 07 '11 at 06:25