After reading your comments, and that of Frank's, and having this exact same problem, I'll share with you what got it to work for me.. (fyi: I'm using Apache 1.3.22, GD 1.8.4, PHP 4.1.1, and MySQL 3.23.42, on a RedHat 7.1 system Kernel 2.4.2)
First: I assume you have the sources for GD, Apache, and PHP installed relative to eachother in a common tree.. (eg: /usr/src)
Second: I assume you've installed the appropriate libraries for jpeg, png, freetype, etc.
Third: I assume Apache, GD and PHP were at once point installed correctly from the sources you have.
Here's the steps I took..
1: inside the php source-dir, type 'rm config.cache' then 'make clean'.
2: Find the png, jpeg, and zlib libraries. On my system png and jpeg are in /usr/lib, and zlib is in /usr/include.
3: type './configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.22 --enable-track-vars --with-gd=../gd-1.8.4
--with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/include' (of course modifying paths to reflect the versions of the software you have)
4: If you haven't run ./configure in the apache source-dir yet, do so now, with whatever options you need.
5: stop apache (apachectl stop)
6: go back to the PHP source-dir, type 'make', then 'make install'.
7: go back to the Apache source-dir, type 'make', then 'make install'.
8: If all goes well, you should get the OK mesage from the apache install script, at which point you should start apache back up (apachectl start), and access a file with only the line '<?phpinfo();?>'.
9: Look for the section entitled, 'gd', and see if GD/JPEG/PNG support is enabled.
If not, either you're missing some headers or libraries (check the output of ./configure in both apache and php for any error 2 or error 1's), the path to those libraries is incorrect, or you forgot to do the traditional './configure', 'make', 'make install' in the gd source-dir. 🙂
Hope this helps maanngg.
-- Nick