繁体   English   中英

如何安装 bcmath 模块?

[英]How to install bcmath module?

如何在服务器上安装 bcmath 模块? 我试过

yum update php-bcmath

但它说它什么也没找到。

尝试yum install php-bcmath 如果仍然找不到任何东西,请尝试yum search bcmath查找包名称

ubuntu 和 php7.1

sudo apt install php7.1-bcmath

ubuntu 和 php 没有版本说明

sudo apt install php-bcmath
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

不知道为什么我必须深入考虑 yum 安装在 phpinfo() 中给了我 bcmath

在 CentOS 6.5 上运行良好

yum 安装 bcmath

我对 bcmath 函数的所有调用都在 apache 重启后立即开始工作

服务 httpd 重启

甜的!

使用 Docker 官方 PHP 镜像时,请使用docker-php-ext-install bcmath

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

正在调用未定义的函数bcmod()

yum install php-bcmath
systemctl restart httpd.service

然后,您应该会在 phpinfo 下看到类似于/etc/php.d/bcmath.ini

Centos 7
Plesk 12
PHP 5.4.16

如果您已经安装了php 7.1那么这条线可以在您的系统上运行。

sudo apt install php7.1-bcmath

ubuntu 16.04上检查您系统中的 php 版本

php -v

然后结果显示在那里..

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

以下使用 remi 存储库在 Centos 7.4 和 PHP 7.1 上为我工作。

首先找出我有哪个PHP版本:

[kiat@reporting ~]$ php --version
PHP 7.1.33 (cli) (built: Oct 23 2019 07:28:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies

然后在remi-php71仓库中搜索bcmath扩展:

[kiat@reporting ~]$ yum search php71 | grep bcmath
php71-php-bcmath.x86_64 : A module for PHP applications for using the bcmath
php71u-bcmath.x86_64 : A module for PHP applications for using the bcmath

现在安装第一个匹配的扩展:

[kiat@reporting ~]$ sudo yum --enablerepo=remi-php71 install php-bcmath
Loaded plugins: fastestmirror, langpacks
base                                                     | 3.6 kB     00:00
.
.
.

最后,重启php和nginx:

[kiat@reporting ~]$ sudo systemctl restart php-fpm nginx

我发现没有启用包含该包的 repo。 在 OEL7 上,

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

$ yum install php-bcmath

这有效......

我使用以下命令查找包的位置

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

如果你想启用任何扩展,那么你必须先安装一个扩展,扩展可能启用但没有安装,以 bcmath 为例

1.yum搜索php-bcmath

2.然后确保您要安装此扩展程序的php版本

3.你会得到像yum search命令之后的输出>>

yum search php-bcmath** 加载的插件:fastestmirror、universal-hooks 从缓存的主机文件加载镜像速度

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.您可以从上述步骤安装任何扩展。

在 Ubuntu PHP 7.3 中

sudo apt install php7.3-bcmath

Arch LinuxManjaro启用bcmath

编辑php.ini

nano /etc/php/php.ini

取消注释bcmath (去掉分号)

extension=bcmath

如果您使用的是 Apache 服务器,请通过以下方式重新加载服务器

sudo systemctl reload apache.server

或者

sudo systemctl realod httpd

如果你不使用Apache

sudo systemctl reload php-fpm.service

查看激活的模块

php -m

要确保安装并激活了bcmath ,请搜索它

php -m | grep bcmath

这对我install php72-php-bcmath.x86_64然后,

systemctl restart php72-php-fpm.service

对于 PHP 7+ 版本,您只能使用:

sudo apt install php-bcmath

我刚刚尝试了下面的 php v5.6 包,它对我有用。

yum install php56w-bcmath

apt repo 具有此扩展名,只需从终端运行以下命令 ::

须藤 apt-get 安装 php7.2-bcmath*

如果仍然有人不知道如何安装 bcmath,因为它有很多其他的依赖模块要安装,比如 php7.2-common 等。

尝试使用突触应用程序进行安装。 开火命令。\\

sudo apt-get install synaptic

打开突触应用程序,然后单击搜索选项卡。

搜索bcmath

搜索结果将显示所有依赖于 php 的包。

根据您的方便安装。

并安装它需要安装的所有自动填充的依赖项。

就是这样。

对于带有 php7.0 的 Centos 7

安装 CentOS SCLo RH 软件库: yum install centos-release-scl-rh

安装rh-php71-php-bcmath rpm包: yum install rh-php71-php-bcmath

systemctl restart httpd.service

如果你想在 ubuntu 中安装 PHP 扩展。

首先知道哪个 PHP 版本是活动的。

php -v

之后使用此命令安装所需的插件。

sudo apt install php7.0-bcmath

您可以将 php7.0-bcmath 替换为php-PHPVersion-extensionName

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM