如何在 Ubuntu 中为 PHP 7.1 安装 bcmath

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43905580/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:56:01  来源:igfitidea点击:

How to install bcmath in Ubuntu for PHP 7.1

phpubuntu-16.04ubuntu-serverphp-7.1bcmath

提问by Vajira Lasantha

I'm using an Ubuntu 16 server for testing with php7.1. One of my app uses bcaddfunction. I know that I need to install bcmathmodule 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-bcmathmodule.

我正在使用 Ubuntu 16 服务器进行php7.1. 我的一个应用程序使用bcadd函数。我知道我需要为此安装bcmath模块,但我找不到php7.1-bcmath. 当我尝试安装时apt install php-bcmath,它只是安装了php7.0-bcmath模块。

I was unable to find php7.1-bcmathmodule anywhere to install on my server. Does anybody has an idea?

我无法php7.1-bcmath在我的服务器上的任何地方找到要安装的模块。有人有想法吗?

apt install php7.1-bcmathreturned following,

apt install php7.1-bcmath返回以下,

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'

回答by Vajira Lasantha

Answering my own question. Managed to fix this issue with following repo update.

回答我自己的问题。通过以下 repo 更新设法解决了这个问题。

add-apt-repository ppa:ondrej/php
apt update
apt install php7.1-bcmath

Restart apache and all good to go.

重启 apache 一切顺利。

回答by Anass Ez-zouaine

install this : https://packages.ubuntu.com/fr/artful/amd64/php7.1-bcmath/download

安装这个: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

到 /etc/apt/sources.list

$ sudo apt update

$ sudo apt install php7.1-bcmath