How to check if GD is installed and if so enable it

Hey, is there a way to check if GD is installed? Usually when I do the phpinfo() function it gives me an area with GD information. On this server I do not see that. The only line with GD in it is as follows:

with-gd=shared’ ‘–enable-gd-native-ttf’ '–without-gdbm

How can I check if it is installed? And if it is installed how do I enable it?

There should be a line in your php.ini:


;   extension=gd2.so

Or something like that (depending on your OS). Uncomment it and restart the server (if it runs as Apache module).

The server is running Red Hat Linux. Let me open up the php.ini file and see if its there. Thanks.

Thats nice…

That line does not exist in my php.ini nor is there a file called gd2.so.

It may be in another config file. Check if you have php.d directory in /etc. It may be in there. Also, when you’re saying there’s no gd.so do you mean you checked in the extensions path? If it’s not there then you’re gonna have to install it (and recompile PHP with option to include GD instruction set).

I see a php.d, what am I supposed to look for in there? Im not the one who searched for the gd2.so so I dont know where he searched for it. Is there a specific place I can give him to look for it?

If the file doesnt exist in the said place does that mean that its not installed?

List the files in php.d. It may have a gd.ini, extensions.ini, or modules.ini file or the likes. Look in them for a line:


; extension=gd.so

or something like that.

Yes. Open php.ini and find a line that starts with:


extension_dir =

This will tell you in which directory gd.so should be in.

Yes, it will mean that there is no GD library and most likely that PHP was compiled without support for GD anyway.

Just checked the extensions directory and gd2.so is not one of the files there. So if I understood correctly that means it is not installed. I would like to install PHP 5 with GD. Is there a place with instructions on how to upgrade to PHP 5 and during the installation is GD installed automatically?

I have been on a shared hosting environment until now and this type of things usually were taken care of already.

There’s plenty of resources online:

http://uk2.php.net/manual/en/image.installation.php

Ok thank you, will read up on that. Ill post back if I run into problems. Thanks again!