I'm using an Ubuntu 16 server for testing with php7.1
. One of my app uses bcadd
function. I know that I need to install bcmath
module for that but I'm unable to find php7.1-bcmath
. When I tried to install apt install php-bcmath
, it simply installed php7.0-bcmath
module.
I was unable to find php7.1-bcmath
module anywhere to install on my server. Does anybody has an idea?
apt install php7.1-bcmath
returned following,
E: Unable to locate package php7.1-bcmath
E: Couldn't find any package by glob 'php7.1-bcmath'
E: Couldn't find any package by regex 'php7.1-bcmath'
Install BCMath Extension in PHP – Windows Open your active php. ini and look for the line extension=php_bcmath. dll. If that line is commented with ; at the start then you just need to remove that ; and restart apache will load this BCMath extension with PHP.
BCMath is set of PHP functions that allow to you to use Arbitrary-precision arithmetic. This package is basically going to be a wrapper for these functions so that they can be used in an object oriented way. The class will allow you to input certain values and run one of the BCMath commands.
Answering my own question. Managed to fix this issue with following repo update.
add-apt-repository ppa:ondrej/php
apt update
apt install php7.1-bcmath
Restart apache and all good to go.
install this : https://packages.ubuntu.com/fr/artful/amd64/php7.1-bcmath/download
add this :
deb http://security.ubuntu.com/ubuntu artful-security main universe
to /etc/apt/sources.list
$ sudo apt update
$ sudo apt install php7.1-bcmath
Those who are looking for Ubuntu 20.04:
sudo apt install php-bcmath
It will automatically install the bcmath compatible with your version of PHP.
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