install php70-gd on ubuntu

PhpGdPhp 7

Php Problem Overview

Recently the new php7 has been released. However, when I am trying to install the gd package, the library can not be found.

I have tried through

sudo apt-get install php70-gd 


sudo apt-get install php70-php-gd

Does anybody have an idea if gd is available for php 7?

Php Solutions

Solution 1 - Php

PHP7 packages for Ubuntu including php7.0-gd can be installed via PPA for PHP by Ondřej Surý:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Next, install the desired version:

sudo apt-get install php7.0-gd
# or
sudo apt-get install php7.1-gd
# or
sudo apt-get install php7.2-gd
# or
sudo apt-get install php7.3-gd
# or
sudo apt-get install php7.4-gd


As MacroMan stated, under Ubuntu 16.04 you don't need to add the repository any more. Simply issuing sudo apt-get install php7.0-gd works.

Solution 2 - Php

just try

sudo apt-get install php7.0-gd 

i got it working that way. Greetings.

Solution 3 - Php

In 2018, there is an alias package for this:

sudo apt-get install php-gd

Use this to retrieve the last version.

Solution 4 - Php

my php version is 7.1

sudo apt-get install php7.1-gd

this command is work for me

Solution 5 - Php

For Ubuntu 16.04.4 LTS

this is the command:

sudo apt-get install php7.0-gd

Solution 6 - Php

check php verison first using

php -v

It will give version number suppose your version is 7.0.1 then use this command to install GD Library

 sudo yum install php70-gd

OR use this command depending upon server specification

sudo apt-get install php7.0-gd


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionapfzView Question on Stackoverflow
Solution 1 - PhpLimon MonteView Answer on Stackoverflow
Solution 2 - PhpEmanuelView Answer on Stackoverflow
Solution 3 - PhpTino RübView Answer on Stackoverflow
Solution 4 - PhpMd. Noor-A-Alam SiddiqueView Answer on Stackoverflow
Solution 5 - PhpAnoop SainiView Answer on Stackoverflow
Solution 6 - PhpSHUBHAM SINGHView Answer on Stackoverflow