如何在Ubuntu for PHP 7.1中安装bcmath

时间:2017-05-11 02:36:57

标签: php ubuntu-16.04 ubuntu-server php-7.1 bcmath

我使用Ubuntu 16服务器进行php7.1测试。我的一个应用使用bcadd功能。我知道我需要为此安装bcmath模块,但我无法找到php7.1-bcmath。当我尝试安装apt install php-bcmath时,它只是安装了php7.0-bcmath模块。

我无法在我的服务器上找到php7.1-bcmath模块。有人有想法吗?

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'

3 个答案:

答案 0 :(得分:22)

回答我自己的问题。通过以下repo更新来管理解决此问题。

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

重启apache,一切顺利。

答案 1 :(得分:5)

安装此: https://packages.ubuntu.com/fr/artful/amd64/php7.1-bcmath/download

添加:

deb http://security.ubuntu.com/ubuntu artful-security main universe

到/etc/apt/sources.list

$ sudo apt update

$ sudo apt install php7.1-bcmath

答案 2 :(得分:2)

那些正在寻找 Ubuntu 20.04 的人:

sudo apt install php-bcmath