我无法在我的服务器上安装php-gd扩展。
我有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:
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?
有什么想法可以解决这个问题吗?
curl -s https://packages.sury.org/php/apt.gpg | sudo apt-key add -
- viktorkho包php7.2-gd不可用,但被另一个软件包引用。
- viktorkhobuster
是debian-testing
的代号,这就是问题所在。现在,buster
已经成为debian-stable
,因此,上面的答案应该提供一个选项来安装php7.2-gd
包。在Debian Buster(稳定版)上测试过,可以正常工作。 - Joey