Linux, PHP: How to install php_gmp module


Step 1: install php-gmp

[root@CentOS-75-64-minimal /]# yum install php-gmp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.checkdomain.de
 * epel: mirror.wiuwiu.de
 * extras: mirror.checkdomain.de
 * remi-php71: mirror.23media.de
 * remi-safe: mirror.23media.de
 * updates: mirror.checkdomain.de
Resolving Dependencies
--> Running transaction check
---> Package php-gmp.x86_64 0:7.1.20-1.el7.remi will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch          Version                   Repository         Size
================================================================================
Installing:
 php-gmp        x86_64        7.1.20-1.el7.remi         remi-php71         67 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 67 k
Installed size: 134 k
Is this ok [y/d/N]: y
Downloading packages:
php-gmp-7.1.20-1.el7.remi.x86_64.rpm                       |  67 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : php-gmp-7.1.20-1.el7.remi.x86_64                             1/1
  Verifying  : php-gmp-7.1.20-1.el7.remi.x86_64                             1/1

Installed:
  php-gmp.x86_64 0:7.1.20-1.el7.remi

Complete!

Now you can see file gmp.so and 20-gmp.ini

[root@CentOS-75-64-minimal /]# find -name gmp.so
./usr/lib64/php-zts/modules/gmp.so
./usr/lib64/php/modules/gmp.so
[root@CentOS-75-64-minimal /]# find -name *gmp.ini
./etc/php.d/20-gmp.ini
./etc/php-zts.d/20-gmp.ini

Step 2 (optinal if not exists file /etc/php.d/20-gmp.ini): restart PHP-FPM

service php-fpm restart

now you can see gmp in phpinfo:

gmp

Leave a Reply