0

I just installed PHP 7.2 from the tarsal on my Mac High Sierra system. When I ran the ./configure step, I did so with the command

./configure --with-gmp

However, when I check the version of PHP, I get a warning that the "gmp.so" module isn't installed.

localhost:php-7.2.1 davea$ php -version
PHP Warning:  PHP Startup: Unable to load dynamic library 'gmp.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so (dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so, 9): image not found), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so.so (dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'gmp.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so (dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so, 9): image not found), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so.so (dlopen(/usr/local/lib/php/extensions/no-debug-non-zts-20170718/gmp.so.so, 9): image not found)) in Unknown on line 0
PHP Deprecated:  Directive 'track_errors' is deprecated in Unknown on line 0

Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
PHP 7.2.1 (cli) (built: Jan 30 2018 19:27:19) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

How do I enable the GMP extension for PHP 7.2 on a Mac?

Dave
  • 15,639
  • 133
  • 442
  • 830
  • Did you download the GMP library? http://php.net/manual/gmp.requirements.php. Also see this comment on the _Installation_ page ~ http://php.net/manual/gmp.installation.php#87930 – Phil Jan 31 '18 at 02:09
  • No, I hadn't not installed GMP (thought that got done for me). I installed via your link but where does it get installed to? It said "/usr/local" on their home page but I don't see anything in my /usr/local after the configrue/make/make install process. Consequently, building PHP with "./configure --with-gmp=/usr/local" did not heal the pain. – Dave Jan 31 '18 at 22:39

1 Answers1

0

If is it fresh install, maybe cannot find your extension files. Try to uncomment extension_dir in php.ini

;extension_dir = 

extension_dir = 
Alper AKPINAR
  • 71
  • 3
  • 10