Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install GMP for PHP7 on Ubuntu

Tags:

php

ubuntu

I was getting the following error when trying to run composer update on a SimpleSAML project.

- openid/php-openid dev-master requires ext-gmp * -> the requested PHP extension gmp is missing from your system. 

Running sudo apt-get install php5-gmp did not work and neither did sudo apt-get install php7-gmp

like image 517
Sam Malayek Avatar asked Oct 12 '16 23:10

Sam Malayek


People also ask

What is GMP PHP extension?

GMP stands for GNU Multiple Precision Arithmetic Library (GMP). GMP is a library supported in PHP that allows you to do mathematical operations on signed integers, rational numbers, and floating point numbers. GMP has a rich collection of functions that helps to perform complex mathematical operations on big numbers.


1 Answers

To install GMP for PHP7.0 on Ubuntu, run: sudo apt-get install php7.0-gmp

Make sure your php.ini contains the following: extension=php_gmp.so

To find out where your php.ini is located, run: php --ini

like image 67
Sam Malayek Avatar answered Sep 25 '22 08:09

Sam Malayek