Install PHP70-Gd on Ubuntu

install php70-gd on ubuntu

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.

Enable GD support on PHP 7.2 in a Ubuntu 18.04

This command will install the GD extension only if PHP 7.2 is already installed.

If not, it will also install php7.2-common since it is a dependency.

On a machine without PHP 7.2:

sudo apt install php7.2-gd

Reading package lists... Done
[...]
The following additional packages will be installed:
php7.2-common
The following NEW packages will be installed:
php7.2-common php7.2-gd

and with PHP 7.2 installed:

sudo apt install php7.2-gd

Reading package lists... Done
[...]

The following NEW packages will be installed:
php7.2-gd

Once installed, the GD config files will be created under /etc/php/7.2/(fpm|cli...)/conf.d and should be named xx-gd.ini.

These config files are loaded after your main php.ini and contain extension specific settings (in your case, GD settings).



Related Topics



Leave a reply



Submit