Ubuntu上的PHP gd安装

nc1teljy  于 2023-09-29  发布在  PHP
关注(0)|答案(1)|浏览(129)

我只是尝试用这个命令在我ubuntu服务器上安装php gd库

sudo apt-get install php7.4-gd

但总会回来

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php7.4-gd
E: Couldn't find any package by glob 'php7.4-gd'
E: Couldn't find any package by regex 'php7.4-gd'

也许有人知道吗我正在尝试任何命令,但返回相同
btw im using php 7.4 in Ubuntu 18.04.5 LTS.

cygmwpex

cygmwpex1#

php7.4已经过了它的生命周期,所以这个包可能不再被支持了。如果你想使用这个版本,你可以试试:

sudo apt-get install software-properties-common
   sudo add-apt-repository ppa:ondrej/php
   sudo apt-get update
   sudo apt-get install php7.4-gd

如果它不起作用,可能是回购的问题。另请查看是否识别该软件包:

sudo apt-cache search php7.4-gd

它应该返回:

php7.4-gd - GD module for PHP

还有:

sudo apt show php7.4-gd

   Package: php7.4-gd
    Version: 7.4.3-4ubuntu2.19
    Priority: optional
    Section: php
    Source: php7.4
    Origin: Ubuntu
    Maintainer: Ubuntu Developers <[email protected]>
    Original-Maintainer: Debian PHP Maintainers <[email protected]>
    Bugs: https://bugs.launchpad.net/ubuntu/+filebug
    Installed-Size: 146 kB
    Provides: php-gd
    Depends: php-common (>= 1:73), ucf, php7.4-common (= 7.4.3-4ubuntu2.19), libc6 (>= 2.4), libgd3 (>= 2.1.1)
    Homepage: http://www.php.net/
    Download-Size: 28,0 kB
    APT-Sources: http://ro.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages

相关问题