enable GIF support in GD2/PHP

eldvis

Registered
as you can tell from the title I'm a little out of my depth here. I'm creating a site that deals with both GIF and JPEG functions in PHP. I can test the code with reference to JPEGs locally, but when I test code with reference to GIFs locally I get this:


Fatal error: Call to undefined function: imagecreatefromgif()


The php code that produced this error works on my web hosts server so I'm guessing it must be to do with local support of GIFs. I searched this forum but only found 1 thread that I didn't understand. Attached is a screen shot from phpinfo() on my mac.

hope you guys have the answer. testing sites on a server with a 56K modem sucks.

thanks.
 

Attachments

You'll need to give us more info...

What is PHP trying to do?

What does the imagecreatefromgif() function do?

If it is reading files from the filesystem, is yours set up exactly like your ISP?
 
ok

php is trying to create a GIF file. The function imagecreatefromgif() doesn't work but the function imagecreatefromjpeg() does. The same with imagegif(), that doesn't work but imagejpeg() does. I am sure it is to do with GIF support in php.

This morining I checked my web host servers config (see attachment) - under the gd configuration it says

GIF Read Support : enabled
GIF Create Support : enabled

I don't have that locally on my mac and I'm sure that's what I have to change but I have no idea how to do that.


thanks
 

Attachments

Download PHPMyAdmin and you should be able to change your PHP settings.

Can you link us the site that you are working on so we can see what you have so far?
 
I think I have the answer.

early versions of gd contained support for GIF files however Unisys hold the patent for the LZW compression used to create GIFs so in versions of gd 1.6 or earlier GIFs are supported but after that support was switched to PNGs. I guess there are some politics going on behind this decision.

I have version gd 2, my web hosts server has gd 1.6 so unless I revert back to an earlier version of php I'm going to have to use PNGs, or test every script on my web hosts server.

For the same image converted to GIF and PNG i got

GIF 127 bytes
PNG 309 bytes

and I'm very anal about saving every last byte I can.

So I guess the question is... Does anyone know how I can revert back to gd 1.6 ????

thanks
ed.
 
Back
Top