This post helps you to install GMP Math on cPanel server. GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. There is no practical limit to the precision except the ones implied by the available memory in the machine GMP runs on. GMP has a rich set of functions, and the functions have a regular interface.
EasyApache 3
If you are running EasyApache 3 on your cPanel server, please run the following commands to install GMP Math.
cd /usr/local/src/ wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.gz tar -xvf gmp-4.3.2.tar.gz cd gmp-4.3.2 ./configure make make check make install
Open the file “all_php5”
vim /var/cpanel/easy/apache/rawopts/all_php5
Add the following into it
--with-gmp
Build EasyApache with default settings.
/scripts/easyapache --build
Once the build is completed, please run the following command to verify gmp is installed properly.
php -m | grep gmp
EasyApache 4
If you are running EasyApache 4 on your cPanel server, then the installation is quite simple. Execute the following commands to enable GMP Math on different PHP versions which is available on EasyApache 4.
PHP 5.4
yum install ea-php54-php-gmp
PHP 5.5
yum install ea-php55-php-gmp
PHP 5.6
yum install ea-php56-php-gmp
PHP 7.0
yum install ea-php70-php-gmp
PHP 7.1
yum install ea-php71-php-gmp
PHP 7.2
yum install ea-php72-php-gmp
PHP 7.3
yum install ea-php73-php-gmp
PHP 7.4
yum install ea-php74-php-gmp
PHP 8.0
yum install ea-php80-php-gmp
PHP 8.1
yum install ea-php81-php-gmp
That’s it!
Check out our cheap and reliable web hosting