Install GD on Ubuntu



The WordPress plugin Imsanity requires GD to work.

This is the error message you might get:

Oh Snap! Imsanity was unable to resize this image for the following reason: ‘No editor could be selected.’ . If you continue to see this error message, you may need to either install missing server components or disable the Imsanity plugin. If you think you have discovered a bug, please report it on the Insanity support forum

Install GD on Ubuntu is a straight forward task

To check if Ubuntu already has GD installed:

php7.0 -m | grep -i gd

If GD is installed then it should print:


If there is no answer, then you should install GD with this command:

sudo apt-get install php7.0-gd

Reboot the server or at least restart apache to make GD start working.

To restart the server:

sudo reboot now

To reboot apache:

sudo service apache2 restart

Detailed information about GD

To get mor info about your GD installation type this command:

php7.0 -i | grep -i --color gd


php -i | grep -i --color gd

The output could look like this:

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


Alternative solution to verify that GD is installed

Create a file called test.php with the following content:


Place test.php your web server root directory such as


Run test.php as follows:

Look for GD extension in the long page that is displayed about you PHP configuration.