Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install php70-gd on ubuntu

Tags:

php

php-7

gd

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  

and

sudo apt-get install php70-php-gd 

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

like image 973
apfz Avatar asked Dec 19 '15 06:12

apfz


People also ask

How do I know if GD library is installed Ubuntu?

You can check to see if the GD library is enabled by creating a simple phpinfo page on your web server. Open this file in Notepad, or your preferred WYSIWYG editor such as Dreamweaver. phpinfo();

What is a GD image?

GD is an open source code library for the dynamic creation of images. GD is used for creating PNG, JPEG and GIF images and is commonly used to generate charts, graphics, thumbnails on the fly. While not restricted to use on the web, the most common applications of GD involve web site development.


1 Answers

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 

EDIT:

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.

like image 180
Limon Monte Avatar answered Sep 21 '22 12:09

Limon Monte