3

A Wordpress installation I am working on, for some images, is giving an error, "GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library".

How can I install and/or connect the GD Library, on an Ubuntu server, so that Wordpress sees what it needs to display these images?

Thanks,

4 Answers 4

9

Install gd:

sudo apt-get install php5-gd
/etc/init.d/apache2 restart

And verify:

php5 -m | grep -i gd

That should do the trick!

3

Install php GD module:

sudo apt-get install php5-gd

2

For PHP 7.0 use

sudo apt-get install php7.0-gd
0

The right way to do this is to find the version of PHP you are using and then install that version of GD:

~$ php --version
PHP 7.3.19-1+ubuntu16.04.1+deb.sury.org+1 (cli) ...

I'm running PHP 7.3 so I check apt:

~$ apt search php7.3-gd
Sorting... Done
Full Text Search... Done
php7.3-gd/xenial,now 7.3.19-1+ubuntu16.04.1+deb.sury.org+1 i386 [installed]
  GD module for PHP

~$ sudo apt-get install php7.3-gd
...

~$ sudo systemctl restart apache2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .