软件包"php5-gd"没有候选安装 [英] Package 'php5-gd' has no installation candidate

查看:553
本文介绍了软件包"php5-gd"没有候选安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"PHP模块gd:丢失"我收到了这样的错误.并且我正在尝试安装php5-gd.

"PHP module gd: Missing" I received such an error. and I'm trying to install php5-gd.

apt-get install php5-gd

我正在使用Ubuntu 16.10和PHP版本7.我进行了所有更新.

I am using Ubuntu 16.10 and PHP version 7. I made all the updates.

当我尝试安装php5-gd时,出现如下错误.

When I tried to install php5-gd, I got an error like below.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5-gd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php5-gd' has no installation candidate

推荐答案

首先通过sudo php -v检查您拥有哪个php版本.我有php7,所以结果是:

First check which php version you have by sudo php -v. I have php7 so the result is:

PHP 7.0.18-0ubuntu0.17.04.1 (cli) (built: Apr 26 2017 23:59:48) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.18-0ubuntu0.17.04.1, Copyright (c) 1999-2017, by Zend Technologies

因为我有php7,所以我将执行以下操作以列出php软件包

since i have php7, I will do the following to list the php packages

sudo apt-cache search php7-* 

此返回

libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php-all-dev - package depending on all supported PHP development packages
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-json - JSON module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-pspell - pspell module for PHP
php7.0-readline - readline module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php-amqp - AMQP extension for PHP
php-apcu - APC User Cache for PHP
php-gearman - PHP wrapper to libgearman
php-geoip - GeoIP module for PHP
php-gmagick - Provides a wrapper to the GraphicsMagick library
php-gnupg - PHP wrapper around the gpgme library
php-http - PECL HTTP module for PHP Extended HTTP Support
php-igbinary - igbinary PHP serializer
php-imagick - Provides a wrapper to the ImageMagick library
php-libsodium - PHP wrapper for the Sodium cryptographic library
php-mailparse - Email message manipulation for PHP
php-memcache - memcache extension module for PHP
php-memcached - memcached extension module for PHP, uses libmemcached
php-mongodb - MongoDB driver for PHP
php-msgpack - PHP extension for interfacing with MessagePack
php-oauth - OAuth 1.0 consumer and provider extension
php-pinba - Pinba module for PHP
...and do on

现在要安装软件包,对您所需的软件包运行以下命令

now to install packages run the following command with your desired package

sudo apt-get install php7.0-mysql php7.0-gd php7.0-curl php7.0-recode

注意:php7.0-mysql php7.0-gd php7.0-curl php7.0-recode是上面列出的软件包.

note:php7.0-mysql php7.0-gd php7.0-curl php7.0-recode are the package that are listed above.

更新

不要忘记重启apache sudo service apache2 reload

dont forget to restart apache sudo service apache2 reload

这篇关于软件包"php5-gd"没有候选安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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