How to install bcmath module?

▼魔方 西西 提交于 2019-11-27 05:53:32

问题


How do I install the bcmath module on a server? I tried

yum update php-bcmath

but it said it found nothing.


回答1:


Try yum install php-bcmath. If you still can't find anything, try yum search bcmath to find the package name




回答2:


ubuntu and php7.1

sudo apt install php7.1-bcmath

ubuntu and php without version specification

sudo apt install php-bcmath



回答3:


Worked great on CentOS 6.5

yum install bcmath

All my calls to bcmath functions started working right after an apache restart

service httpd restart

Sweet!




回答4:


yum install php72-php-bcmath.x86_64
cp /etc/opt/remi/php72/php.d/20-bcmath.ini /etc/php.d/
cp /opt/remi/php72/root/usr/lib64/php/modules/bcmath.so /usr/lib64/php/modules/
systemctl restart httpd

Not sure why I had to go so deep considering the yum install gave me bcmath in phpinfo()




回答5:


If you have installed php 7.1 then this line work on your system.

sudo apt install php7.1-bcmath

check your php version in your system on ubuntu 16.04

php -v

and then result show there..

PHP 7.1.x+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Aug 19 2018 07:16:12) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.9-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies




回答6:


When using the official PHP images of Docker, use docker-php-ext-install bcmath.

Source: https://hub.docker.com/_/php?tab=description#php-core-extensions




回答7:


Was getting call to undefined function bcmod()

yum install php-bcmath
systemctl restart httpd.service

you should then see something similar to /etc/php.d/bcmath.ini listed under phpinfo.

Centos 7
Plesk 12
PHP 5.4.16



回答8:


I found that the repo that had the package was not enabled. On OEL7,

$ vi /etc/yum.repos.d/ULN-Base.repo
Set enabled to 1 for ol7_optional_latest

$ yum install php-bcmath

and that worked...

I used the following command to find where the package was

$ yum --noplugins --showduplicates --enablerepo \* --disablerepo \*-source --disablerepo C5.\*,c5-media,\*debug\*,\*-source list \*bcmath



回答9:


if you want enable any extension then you have to install an extension first, extension maybe enabled but not installed so, taking example of bcmath

1.yum search php-bcmath

2.then ensure php version in which u want to install this extension

3.u will get output like after yum search command>>

yum search php-bcmath** Loaded plugins: fastestmirror, universal-hooks Loading mirror speeds from cached hostfile

EA4: 66.71.244.18
cpanel-addons-production-feed: 66.71.244.18
base: mirror.nodesdirect.com
epel: mirror.coastal.edu
extras: www.gtlib.gatech.edu
nux-dextop: mirror.li.nux.ro
updates: mirror.jaleco.com
**============================================================== N/S matched: php-bcmath ===============================================================
ea-php54-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php55-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php56-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php70-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php71-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
ea-php72-php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
then use >yum install ea-php72-php-bcmath.x86_64
5.this bcmath extension for php7.2
6.I wanna install for php71 then the command will be like **yum install ea-php71-php-bcmath.x86_64**  or yum install php71-bcmath.

7.u can install any extension from above steps.




回答10:


I just tried below package for php v5.6 and it worked for me.

yum install php56w-bcmath



回答11:


apt repo have this extension, just run the below command from your terminal ::

sudo apt-get install php7.2-bcmath*




回答12:


If still anyone is not getting how to install bcmath as it has lots of other dependant modules to install like php7.2-common, etc.

Try using synaptic application, to install the same. fire command.\

sudo apt-get install synaptic

Open the synaptic application and then click on search tab.

search for bcmath

search results will show all the packages depends on php.

Install as per your convenience.

and install with all auto populated dependancies it required to install.

That's it.




回答13:


This worked for me install php72-php-bcmath.x86_64 Then,

systemctl restart php72-php-fpm.service



回答14:


For Centos 7 with php7.0

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

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

systemctl restart httpd.service




回答15:


If you want to install PHP extensions in ubuntu.

first know which PHP version is active.

php -v

After that install needed plugin using this command.

sudo apt install php7.0-bcmath

you can replace php7.0-bcmath to php-PHPVersion-extensionName




回答16:


For PHP 7+ version you can use only:

sudo apt install php-bcmath


来源:https://stackoverflow.com/questions/3400362/how-to-install-bcmath-module

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!