【问题标题】:How to install bcmath in Ubuntu for PHP 7.1如何在 Ubuntu for PHP 7.1 中安装 bcmath
【发布时间】:2017-10-09 21:01:06
【问题描述】:

我正在使用 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'

【问题讨论】:

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


    【解决方案1】:

    那些正在寻找 Ubuntu 20.04 的人:

    sudo apt install php-bcmath
    

    它将自动安装与您的 PHP 版本兼容的 bcmath。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      【解决方案3】:

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

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

      重启 apache,一切顺利。

      【讨论】:

      • 如果您没有 ppa,您如何最初安装 php7.1? o_O
      • 请注意,从 2020 年开始,您应该安装 PHP 7.4 版本,apt install php7.4-bcmath
      猜你喜欢
      • 2018-09-11
      • 1970-01-01
      • 2018-09-18
      • 1970-01-01
      • 2011-03-24
      • 2018-04-26
      • 2018-09-29
      • 1970-01-01
      • 2017-11-26
      相关资源
      最近更新 更多