I am trying to install and enable GMP extension for PHP.
Mac OS High Sierra 10.13.5
PHP Version: 7.1.16
Composer version: 1.6.5
Homebrew version: 1.6.9
I am getting this error when I run composer install
.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-gmp * is missing from your system. Install or enable PHP's gmp extension.
The composer.json
has dependency on "ext-gmp": "*"
. I have tried following things:
brew install homebrew/php/php70-gmp
brew install gmp
brew install homebrew/homebrew-core/php70-gmp
php.ini
to enable extension=php_gmp.dll
I'm still getting the same error on composer install. Can anyone please help me with this?
GMP installation in PHP 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. After that restart apache and to confirm if the changes are reflecting.
PHP comes preinstalled on most macOS systems, so you usually don't need any manual installation.
Start Again. Install PHP 7
brew install [email protected]
add php path to ~/.bash_profile
or ~/.zshrc
:
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
then source file, start php and check gmp has been loaded
brew services start [email protected]
source ~/.zshrc
php -info | grep "GMP"
Try Again
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