-1

I need to enable GD support on PHP 7.2 in a Ubuntu 18.04 installation and I've found this solution on the web:

sudo apt-get install php7.2-gd

Since I'm not an expert and I'm worried about the already running configuration files, I have to ask if this command

  • will make a brand new installation of PHP with GD extension included

or

  • will just add the GD extension to my existing PHP installation and I don't have to worry about any configuration file changes
0stone0
  • 34,288
  • 4
  • 39
  • 64
luix10
  • 49
  • 8

1 Answers1

1

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).

Anthony Aslangul
  • 3,589
  • 2
  • 20
  • 30
  • double-checking: no changes to previous existing installation settings, correct? – luix10 Sep 13 '21 at 15:49
  • As far as I know, nothing, I don't see where and why something would change and I never experienced any existing settings modification. Like any other extension, it just installs it. One or multiple config file(s) (depending of the current installation, fpm and/or cli and/or cgi...) should be created under `/etc/php/7.2/(fpm|cgi|cli)`. It'll be named `gd.ini ` or `50-gd.ini` and appended to your current config, it contains the gd specific settings. However, nothing in your current config will change. – Anthony Aslangul Sep 13 '21 at 15:58
  • I updated my answer to include this information. Don't worry: the only downside of gd installation is a negligible hit in performances (like any other extension). The upside is that you can use gd. Nothing less, nothing more. – Anthony Aslangul Sep 13 '21 at 16:04