4

Am running a Centos7 server. This module bcmath wasn't installed,

I installed it yum install php-bcmath.

And it doesn't seem to work. It also doesn't appear in info.php page.

The php version I have is 7.1.12 something.

How do I enable it?

5
  • How did you install PHP 7? Commented Dec 18, 2017 at 7:06
  • Followed a guide on digitalocean. But can't seem to find any info how to enable the bcmath module. Commented Dec 18, 2017 at 7:16
  • Which guide? Put simply, it's likely that PHP 7 isn't being installed from a default repository so you need to know the name of the repository (probably php71-). Commented Dec 18, 2017 at 7:20
  • How can I find that out? When I run yum install php-bcmath it says it is installed. Commented Dec 18, 2017 at 7:28
  • 1
    If it's this guide you will be using the IUS repo, so try yum install php71-bcmath. Commented Dec 18, 2017 at 7:36

7 Answers 7

2

For reference purposes, on Ubuntu 16.04.5 LTS, with PHP 7.0, we use:

apt-get install php-bcmath 
1

PHP will be using an additional repository, usually IUS or Remi, so it is likely that you need to install the php71-bcmath package.

5
  • Says No package php71-bcmath available. Error: Nothing to do. Commented Dec 18, 2017 at 7:41
  • 1
    It says it uses this repository: remi-php71: remi.schlundtech.de Commented Dec 18, 2017 at 7:44
  • Use yum --enablerepo remi.sclundtech.de install php71-bcmath Commented Dec 18, 2017 at 7:48
  • Now it says this: Failed to set locale, defaulting to C Loaded plugins: fastestmirror Error getting repository data for remi.sclundtech.de, repository not found Commented Dec 18, 2017 at 8:01
  • Try yum --enablerepo remi-php71 php71-bcmath` but also refer to the document that you followed to find what repo was set up. Commented Dec 18, 2017 at 8:19
1

Sorry for bumping an old post.

The problem was the command yum install php71-bcmath should be

yum install php7.1-bcmath

0

The correct command is:

sudo yum install php71-php-bcmath 

in case you want to use remi's package https://rpmfind.net/linux/rpm2html/search.php?query=php71-php-bcmath

also after installing it, you probably want to restart apache server if you are running one:

sudo systemctl restart httpd 
0

If you're using centos on linux, and need to 1st find what exact package applies; then the command you're looking for is: yum search bcmath. This should return you a list of bcmath library applicable.

In my case it was: yum install ea-php72-php-bcmath.x86_64

0

For Centos 7 with php7.0

  1. Install CentOS SCLo RH repository:
    yum install centos-release-scl-rh

  2. Install rh-php71-php-bcmath rpm package:
    yum install rh-php71-php-bcmath

  3. Restart Apache
    systemctl restart httpd.service

0

correct command is yum install php71w-bcmath

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.