【问题标题】:How to download php7.2-gd extension in ubuntu 21.04?如何在 ubuntu 21.04 中下载 php7.2-gd 扩展?
【发布时间】:2021-11-09 10:05:23
【问题描述】:

我想在我当前的 php-project(php 版本为 7.2.34)中安装 gd 扩展,因为我使用此命令 sudo apt-get install php7.2-gd 它会引发以下错误,并且当我运行 php -m 命令时它没有显示在列表中,如何安装gd扩展请帮我解决这个问题..

Error

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
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:
 php7.2-gd : Depends: libjpeg62-turbo (>= 1.3.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

【问题讨论】:

    标签: php php-extension php-gd


    【解决方案1】:

    这个包依赖libjpeg62-turbo所以你需要先安装它

    wget http://ftp.debian.org/debian/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_amd64.deb
    sudo apt-get install ./libjpeg62-turbo_1.5.1-2_amd64.deb
    

    之后,您可以轻松安装您的包

    sudo apt-get install php7.2-gd
    

    【讨论】:

    • 显示 libjpeg62-turbo-dev 没有安装候选
    • 我在安装 php7.2-curl 时也遇到了类似的问题。 php7.2-curl : Depends: libcurl3 (>= 7.44.0) 但它不可安装 E: 无法纠正问题,您持有损坏的软件包。
    • 先安装 curl sudo apt install curl
    • 运行sudo apt install libcurl3
    • 它抛出以下错误 E: Unable to locate package libcurl13
    猜你喜欢
    • 2019-05-24
    • 2016-03-04
    • 2023-01-19
    • 2011-05-08
    • 2011-10-04
    • 2011-01-17
    • 1970-01-01
    • 2019-12-03
    • 2017-11-26
    相关资源
    最近更新 更多