在Debian上安装php-gd ext [英] install php-gd ext on Debian

查看:243
本文介绍了在Debian上安装php-gd ext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在服务器上安装php-gd扩展。

I'm not able to install php-gd extension on my server.

我有php 7.2:

PHP 7.2.10-1+0~20181001133426.7+jessie~1.gbpb6e829 (cli) (built: Oct  1 2018 13:50:53) ( NTS )

和debian 8 Linux:

and debian 8 linux:

Debian GNU/Linux 8

安装GD扩展的命令:

sudo apt-get install php7.2-gd

和结果:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libc-ares2 libnfsidmap2 libpcre16-3 libpcre32-3 libuuid-perl libv8-3.14.5 php-http-request php-mail-mimedecode php-net-dime php-net-url
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  php7.2-gd
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 27.5 kB of archives.
After this operation, 186 kB of additional disk space will be used.
Get:1 https://packages.sury.org/php/ jessie/main php7.2-gd amd64 7.2.10-1+0~20181001133426.7+jessie~1.gbpb6e829 [27.5 kB]
Err https://packages.sury.org/php/ jessie/main php7.2-gd amd64 7.2.10-1+0~20181001133426.7+jessie~1.gbpb6e829
  HttpError404
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php7.2/php7.2-gd_7.2.10-1+0~20181001133426.7+jessie~1.gbpb6e829_amd64.deb  HttpError404

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

有什么想法请解决?

推荐答案

php-7.2-gd 软件包在Debian仓库中尚不可用(尚未)。但这没关系,当然您也可以安装它。有一个很棒的网站,名为 DEB.SURY.ORG ,该网站将不同的软件打包到Debian和Ubuntu中(尤其是PHP软件包) 。

The php-7.2-gd package isn't available in Debian repositories (yet). But that doesn't matter, of course you can install it anyway. There's a great website named DEB.SURY.ORG that packages different software into Debian and Ubuntu (especially PHP packages).

首先,将密钥下载到软件包源:

First, download the key to the package source:

$ sudo curl -s https://packages.sury.org/php/apt.gpg | sudo apt-key add -

然后创建 .list /etc/apt/sources.list.d / 中的$ c>文件:

Then create a .list file in /etc/apt/sources.list.d/:

$ echo "deb https://packages.sury.org/php/ buster main" | sudo tee /etc/apt/sources.list.d/php.list

然后更新升级您的发行版:

$ sudo apt update -y && sudo apt dist-upgrade -y

现在您应该可以安装 php7.2-gd 包,方法是运行:

Now you should be able to install the php7.2-gd package by running:

$ sudo apt install php7.2-gd

这篇关于在Debian上安装php-gd ext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆