无法在 Debian 上安装 php7.2-bcmath

时间:2021-06-08 22:15:16

标签: linux debian

我按照说明做所有事情:PHP | "The requested PHP extension bcmath is missing from your system."

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication2.Models;


namespace WebApplication2.Controllers
{
    public class CollegeController : Controller
    {
        // GET: College
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult GetData()
        {
            using (DBModel db = new DBModel())
            {

            }
        }

    }
}

我明白了:

<块引用>

正在读取包列表...完成构建依赖树读取状态 信息...完成 E:无法找到包 php7.2-bcmath E: 通过正则表达式'php7.2-bcmath'找不到任何包

为什么系统找不到这个模块?

2 个答案:

答案 0 :(得分:1)

使用deb.sury.org 只需将 https://packages.sury.org/php/ 添加到您的 apt/sources.list,瞧。有 php7.2-bcmath 和很多其他的 php 东西

答案 1 :(得分:0)

这对我不起作用。 我将代码添加到文件中(第 8 行)

deb http://mirror.hetzner.de/debian/packages jessie main contrib non-free
deb http://http.debian.net/debian jessie main contrib non-free
deb http://http.debian.net/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
# deb http://ftp.debian.org/debian jessie-backports main contrib non-free
deb http://http.us.debian.org/debian/ jessie main
# deb http://ftp.debian.org/debian stable main contrib
deb https://packages.sury.org/php/

并显示错误:

<块引用>

E:源列表 /etc/apt/sources.list (dist) 中的第 8 行格式错误 E: 无法读取来源列表。

所以我在最后一行添加:“jessie main”

deb http://mirror.hetzner.de/debian/packages jessie main contrib non-free
deb http://http.debian.net/debian jessie main contrib non-free
deb http://http.debian.net/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
# deb http://ftp.debian.org/debian jessie-backports main contrib non-free
deb http://http.us.debian.org/debian/ jessie main
# deb http://ftp.debian.org/debian stable main contrib
deb https://packages.sury.org/php/ jessie main

现在我和以前一样了:

<块引用>

正在读取包列表...完成构建依赖树读取状态 信息...完成 E: 无法找到包 php7.2-bcmath E: 通过正则表达式'php7.2-bcmath'找不到任何包

为什么我仍然无法安装此软件包?