GD Library extension not available with this PHP installation Ubuntu Nginx

@limonte's answer is correct, but if you're using PHP7+, you should use following command:

sudo apt-get install php7.0-gd

If you don't know what version of PHP you're using, just type

php -v

Output should start with something similar to PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS ).


The GD Graphics Library is for dynamically manipulating images. For Ubuntu you should install it manually:

  • PHP5: sudo apt-get install php5-gd
  • PHP7.0: sudo apt-get install php7.0-gd
  • PHP7.1: sudo apt-get install php7.1-gd
  • PHP7.2: sudo apt-get install php7.2-gd
  • PHP7.3: sudo apt-get install php7.3-gd
  • PHP7.4: sudo apt-get install php7.4-gd
  • PHP8.0: sudo apt-get install php8.0-gd
  • PHP8.1: sudo apt-get install php8.1-gd

That's all, you can verify that GD support loaded:

php -i | grep -i gd

Output should be like this:

GD Support => enabled
GD headers Version => 2.1.1-dev
gd.jpeg_ignore_warning => 0 => 0

and finally restart your apache:

sudo service apache2 restart

For my fellow Windows users, find the line ;extension=gd2 in your php.ini file and change it to extension=gd2.

Regards


window users using xampp apache server.

Go to php folder in xampp and open the php.ini and php configurations settings file, and change the line ;extension=gd2 or the line ;extension=gd to just extension=gd2

NB that php version 8 is stored as ;extension=gd