2

I am trying to install GMP (GNU Multiple Precision) for PHP on my VPS. Server OS :- CentOS 6 with cPanel GMP Official Site :- http://www.gmplib.org I have been trying from 8 Days, but have not found any solution.

Cory Knutson
  • 1,876
  • 13
  • 20
Shubham Panchal
  • 51
  • 1
  • 2
  • 7

1 Answers1

6

If you are missing and need GMP itself, you can install GMP from the CentOS Base repository.

yum -y install gmp

As for the php-gmp package, it is not available in the standard CentOS 6 Base repository. You either have to create it yourself which can be tedious, or use a non-standard repository which includes it.


NOTE: Do know that this will replace the standard PHP 5.3 version from CentOS with a newer version maintained by Remi's RPM repository.

It's adviced to run minimum PHP 5.6 as this is not EOL until December 2018.


The easy solution is to install from another repository (REMI repository) instead.

This requires you to have the EPEL repository installed first.

yum -y install epel-release

Then continue to install REMI Repository and yum-utils (to configure PHP version).

yum -y install http://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum -y install yum-utils

To enable the PHP 5.6 repository.

yum-config-manager --enable remi-php56

Upgrade all your installed PHP packages by upgrading the system.

yum -y upgrade

Then finally install the php-gmp package.

yum -y install php-gmp
Alexander K
  • 336
  • 1
  • 5
  • thank you so much for answering my question. but it shows No package php-gmp available https://prnt.sc/fizr1h – Shubham Panchal Jun 12 '17 at 20:29
  • Hold on a minute, is this a cPanel server? I see you have cPanel related repositories and seem to be using EasyApache 4. – Alexander K Jun 12 '17 at 20:31
  • Can you please post the output of: php -v – Alexander K Jun 12 '17 at 20:35
  • output of **php -v** http://prntscr.com/fj02f6 – Shubham Panchal Jun 12 '17 at 20:54
  • 2
    So for cPanel you should *NOT* be fiddling with things like these manually. Remove REMI with: 'yum -y remove remi-release' then run 'yum -y install ea-php56-php-gmp'. If you have multiple PHP versions installed, and the site is not using 5.6 replace "56" with the version it's using. This can also be done via WHM, see "EasyApache 4" in the menu. If you get stuck, you should contact the Datacenter/cPanel support (depending on whom issued the license) for further assistance in this matter. – Alexander K Jun 12 '17 at 21:01
  • installed.. and working.. Thank you so much so much so much .. you saved my days,., – Shubham Panchal Jun 12 '17 at 21:04
  • can you give me any contact ? – Shubham Panchal Jun 12 '17 at 21:04
  • Happy to hear! Just ask on serverfault if you need help with something and I might answer next time too. :-) Please if you can, mark the answer as correct (as it is as long as you don't run cPanel). I'm not sharing my contact information just yet on serverfault. Maybe I will in the future, on the profile. – Alexander K Jun 12 '17 at 21:09
  • check this Question https://serverfault.com/questions/855366/cpanel-not-opening-after-successfully-installation-on-google-cloud-compute – Shubham Panchal Jun 12 '17 at 21:22