How to enable bcmath module in PHP 7.1

21,543

Solution 1

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

apt-get install php-bcmath

Solution 2

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

Share:
21,543

Related videos on Youtube

Nikk
Author by

Nikk

Updated on September 18, 2022

Comments

  • Nikk
    Nikk over 1 year

    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?

  • Nikk
    Nikk over 6 years
    Says No package php71-bcmath available. Error: Nothing to do.
  • Nikk
    Nikk over 6 years
    It says it uses this repository: remi-php71: remi.schlundtech.de
  • Simon Greenwood
    Simon Greenwood over 6 years
    Use yum --enablerepo remi.sclundtech.de install php71-bcmath
  • Nikk
    Nikk over 6 years
    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
  • Simon Greenwood
    Simon Greenwood over 6 years
    Try yum --enablerepo remi-php71 php71-bcmath` but also refer to the document that you followed to find what repo was set up.