Unable to enable ext-gmp

2019-08-21 17:22发布

问题:

So I've been trying to enable gmp on my macbook pro, but upto no avail.

Here's what I've done till now.

  1. Uncommented extension=php_gmp.dll in /private/etc/php.ini
  2. Uncommented extension=php_gmp.dll in /usr/local/php5/lib/php.ini (coonfiguration file as displayed in phpinfo() )
  3. phpinfo() says gmp is enabled, but when I do php -m, it doesnt shows gmp.

What must I do?

回答1:

The lines that you're uncommenting are examples. The extension is not actually present on your system -- you need to install the extension before you can enable it.

The easiest way of doing this will probably be to install the extension through Homebrew. If you have Homebrew installed, you can install the extension by running brew install php72-gmp.



回答2:

If I get you right in your third point, you arr probably only editing the php.ini for web server usage and not the one to be used for CLI? You can find that second ini file through php -i | grep ini