无法安装 php 8.0 bcmath

问题描述 投票:0回答:1

我需要安装 bcmath 模块,因为它是 wordpress ip2location 插件所必需的,但我发现这是不可能的。我关注过其他类似的帖子,但没有任何效果。我正在使用 Ubuntu 18.04.2 LTS、Apache/2.4.29 (Ubuntu) 和 php 8.0.28。

我已经尝试过:

apt update
apt install php-bcmath
Error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-bcmath : Depends: php7.2-bcmath but it is not going to be installed
-------------------------------------------------------
apt install php8.0-bcmath
Error:
E: Unable to locate package php8.0-bcmath
E: Couldn't find any package by glob 'php8.0-bcmath'

E:无法通过正则表达式“php8.0-bcmath”找到任何包

还尝试更改存储库,例如添加 ondrej,同样的错误。

任何想法将不胜感激,谢谢。

php apache ubuntu-18.04 bcmath
1个回答
0
投票

根据 TecAdmin 的说法:

Ubuntu 18.04 默认安装 PHP 7.2。

当您尝试安装 PHP 8.0 相关软件包时,您可以通过向 Ubuntu 添加 PPA(个人软件包档案)来完成此操作,或者通过从源代码编译 PHP,您可用的解决方案是:

  1. 使用
    --enable-bcmath
  2. 从源代码编译 PHP
  3. 添加
    ondrej/php
    PPA - 个人包档案 -.
add-apt-repository ppa:ondrej/php
apt update
apt install php8.0-bcmath
  1. 从源代码编译扩展本身作为共享扩展
© www.soinside.com 2019 - 2024. All rights reserved.