Swedie's picture

Installed Turnkey Lamp v 2009-02 and it has everything I want except for GD library.

What is the simplest way for me to add support for GD library in PHP?

I can't find the libraries anywhere and no .ini file to modify to add support for GD lib like you do on a windows machine.

Alon Swartz's picture

Just install the php5-gd package:
apt-get update
apt-get install php5-gd
It just so happens I am familier with the package, but if I wasn't, I would have done something like:
$ apt-cache search php | grep gd
php5-gd - GD module for php5
You can also use Ubuntu's package web interface: http://packages.ubuntu.com

Swedie's picture

Thank you! A bummer right now though is that I don't have internet on the server. Can I download the php5-gd package, move it manually onto the server, and then install it in a simple way?
Alon Swartz's picture

You will have to download the php5-gd deb package, and all of its dependencies (and the dependencies of the dependencies recursively) of the packages not yet installed on the appliance.

The list of dependencies and download links are available at this link, and you can find the deb packages in the Ubuntu package archive.

You can find out what packages are installed by either looking at the appliance manifest (see link on appliance download page), or by running dpkg-query -W

Once you have downloaded and copied the packages to the appliance, you can install them using dpkg:
dpkg -i PACKAGE.deb

Good luck!
Aaron Arlof's picture

I had this same problem while trying to set up OpenCart on a turnkey lamp install; it wouldn't detect either php5-gd or php5-curl. The curl extension wasn't installed, so a quick install fixed that. However, GD was installed, but OpenCart wouldn't detect it. I fixed it by uninstalling php5-gd by typing 'apt-get autoremove php5-gd' then reinstalling it with 'apt-get install php5-gd'; immediately fixed the problem. Just something to try if you're having a similar problem but the extension(s) are installed.

Austin's picture

Exactly what I was looking for, thanks! Must of had the same lamp install.

Saku Mättö's picture

Thanks to Aaron Arlof

I am installing osTicket on a Turnkey LAMP Stack and it requires GD-lib to show the Captchas for new tickets.

I first did what Alon told to do:

apt-get update
apt-get install php5-gd

but I got the same error "The GD extension required"

Then i removed GD-li as per Aaron advice:

apt-get autoremove php5-gd

then reinstalled it

apt-get install php5-gd

Now osTicket works fine!

quran's picture

do you know how to configure GD Library with FreeType please? 

Add new comment