Click to See Complete Forum and Search --> : Compiling GD 2.0.33 with PHP


cyberchuck
12-14-2004, 09:10 PM
Hello all:

I spent a few hours muckin' with this to get it right, figured someone else might benefit from my hair-tearing :-)

My configuration:

OS: FreeBSD
PHP version : 4.3.9
Desired GD version : 2.0.33 (from the GD site)

PHP 4.3.9 comes "bundled" with a GD 1.x version. My other webperson wanted to have GD 2.x to use some sort of photo library under PHP.

When I tried to use "--with-gd" I got the built-in version (1.x).

When I compiled gd-2.0.33 and did a "make install", then tried to do a

"--with-gd=/usr/local"

I got errors during the "./configure" step.

Turns out GD (at least 2.0.33) requires the
"iconv" library (libiconv).

So I compiled THAT from the net and used the "--with-iconv" option on the "./configure".

Still not enough. GD complained that it couldn't get to the ICONV library.

Final solution:

set "CFLAGS" to "-L/usr/local -liconv"

It was this latter step that finally worked !

Sigh. I assumed that "--with-iconv" automagically would do a "-liconv", but it didn't :-(

Hope this helps some other poor soul(s) out there.

Charlie