It seems people line up for this question, I've got the very same problem as you.

Using also IIS and NT4. I've done some compiling and it worked, but I really don't know what I'm doing and GD support is not working at all.

I've seen GD libraries everywhere and they need additional libraries to be compiled. I've even found a php4 GD library (php_gd.dll) for version 4, but just putting it in my winnt/system32 directory didn't help much.

After you've done everything right, you should have a php.exe, php4ts.dll, php4isapi.dll and probably a new php_gd.dll and you should replace you php.exe and put the dll's in your system32 directory.

However, how the heck do you compile a new php.exe which supports gd, since all the project files don't seem to have the dll. Yet it is in the ext/gd directory of the source files.

Anyway, PLEASE let me know if you found the answer, I'm beginning to loose it ;-(

    I've done it in linux, and it's not pretty.

    I had to download the latest pnglib, jpeglib, AND gdlib and make them all by hand. Then I forcefully removed the same packages that RedHat had installed earlier (old versions) and then ran make install on all the ones I'd made.

    After that I had to edit /etc/ld.so.conf to tell it where the .so files had been put by the different apps, and run ldconfig.

    After that, the standard super long ./configure line of:

    ./configure --with-gd \
    --with-jpeg \
    --with-png

    I don't remember if I had to put directories or not, I think php found the right .so files once I had forcefully de-installed them. (rpm --force -e libname)

      Hi, this is an e-mail I received for this problem. I hope it's usefull for you.

      Good luck

      Sergio

      "
      I had the same probleme, and I try different solution only one works :

      use the the php_gd.dll from download.swwwing.com with the core php software from the same site (under /php4/core download php4ts.dll and phpts.exe or php4isapi.dll)

      phpts.exe replace php.exe (for cgi interface)
      php4isapi.dll replace php4isapi.dll (for isapi interface)
      php4ts.dll replace php4ts.dll

      the ts in phpts.exe is for Tread Safe compilation who is requiered by the gd_lib.dll

      I dont try the isapi module but the cgi one work perfectly with the php_gd.dll

      after installation (and reboot) try this simple php script who generate a simple green box.
      <?php
      Header("Content-type: image/jpeg");
      $im= ImageCreate(220,210);
      $vert = ImageColorAllocate($im, 0, 255, 00);
      ImageJpeg($im);
      ImageDestroy($im);
      ?>

      I hop this help you in your project

      Vinc.

      "

        Hey thanks alot!

        I've been to that site before, with this info I might just make it work.

        (I hope!)

          Well, I followed your lead, but couldn't get the thing working. My problems are now 2 fold. 1) Both the CGI and Isapi versions of php4 give me problems when I try to do file uploads. Next, I receive an error message when i try to load the cgi module with the php_gd.dll. What I really need is a compiled version of the latest GD library that will still work with php3... Any ideas?

          Scott

            The php_gd.dll I can used:
            I use PHP4.0.0 download from www.php.net, and PHP 4.0.1dev downloaded from download.swwwing.com(use 'phpts.exe' rather than 'php.exe'). The php_gd.dll I used is also downloaded from download.swwwing.com.
            It need a file 'zlib.dll', I put it in WINNT\SYSTEM32. The php_gd.dll support PNG, Jpeg & TTF. It works well.
            My env is W2K+IIS5. I can use GD success in CGI mode of both version of PHP, but can't run in ISAPI mode of PHP. So I have to use PHP in CGI mode. I haven't test the newest PHP 4.0.1 from www.php.net.

              i am using php3.0.6 for Window 98
              and i followed the step which recommended by all of u... i downloaded php4ts.dll, php4isapi.dll, and phpts.exe and i put it in php folder..
              but finally it give me error..
              call to unsupported function
              any one there giveme some advices??
              thank you

              cK

                Okay, I'm about to try it out, but people keep talking about:

                php.exe (for cgi interface)
                php4isapi.dll (for isapi interface)

                Can someone please tell me how I use the cgi interface on Win NT 4 with IIS 4, because I don't quite get it...

                I'm a really that stupid? ;-)

                  Hi,

                  You say you use php3.0.6 ? This is what I did:

                  1. download.swwwing.com
                  2. Get the phpts.exe, php4ts.dll, php4isapi.dll from core directory
                  3. Went to the modules directory and downloaded all the DLL files, but I guess I only needed php_gd.dll, php_ldap.dll, php_imap.dll, php_zlib.dll and zlib.dll,
                  4. Stopped IIS services and removed all old PHP files
                  5. Put all the files in my c:\php4 directory (just to be sure)
                  6. Put all DLL files in my c:\winnt\system32 directory (for you that would be c:\system32 I guess)
                  7. Rebooted and (if needed) restart IIS

                  It worked perfectly. However, the example from the php manual (createimagefromgif) didn't work, since it will only support JPG, PNG and TIF (I think). So I changed the example to make it look for my JPG and searched around for JPEG routines to substitue the GIF routines from the manual.

                  After that, I followed Brett's wonderful advice to use the CGI version, but it worked even before. They say the CGI version is more reliable than the PHP4ISAPI.DLL I was using before.

                  BTW, I got an error when I refered to my zlib.dll in the .ini file when I removed reference to it (and only opted php_gd.dll) it worked.

                  I hope this works for you too. Basically I'd say switch from php3 to php4.

                    I tried everything said here but i still have a problem. GD still wont load 'cause there are lib files missing. I now have zlib, imap and ldap but don't you need libpng and jpeg? If so, where can i download dll's.

                      Put the zlib.dll and the php_gd.dll in the
                      in your winnt\system32 directory. You don't need other library. They libpng,... are linked in the php_gd.dll.

                      Add to your php.ini the following line:
                      extension=php_gd.dll
                      and all would be fine.

                      Good luck

                      Sergio

                        I have copied the dlls and it is working correctly yeeeha.
                        Only problem is that every time I call an "Image" function I get a warning:
                        "Unknown list entry type in request shutdown"

                        Anybody know why this is happening?

                          i have copied all the dll file into the php directory... but still cannot works..why??

                          cK

                            11 days later

                            Hi there,

                            so I got this script from Sergio working:

                            <?php
                            Header("Content-type: image/jpeg");
                            $im= ImageCreate(220,210);
                            $vert = ImageColorAllocate($im, 0, 255, 00);
                            ImageJpeg($im);
                            ImageDestroy($im);
                            ?>

                            I simply installed the "php-4.0.1pl2-Win32.zip" version from this site on my PWS.
                            I then changed the php.ini entries to
                            extension_dir = c:/php
                            which is my php-directory and activated
                            extension=php_gd.dll

                            After that, I replaced all files in the php-directory with those from download.swwwing.com/php4/modules/
                            and additionaly took the files
                            php4isapi.dll
                            php4ts.dll
                            phpts.exe
                            from the core-directory, renamed phpts.exe to php.exe and thats it.

                            The problem that remains, is that imagecreategif still doesn't seem to work. I also wonder if I must put an "@" before the function call since then the parser doesn't return the "No GIF-support" Error.

                            Anyone there to help me?!?

                              Hi Daniel,
                              unfortunately gd library doesn't have the support to GIF images since the 1.5 version (or 1.6...). For the LZW compression algorithm inside the gif format they should have to pay royalties. This is the reason for the new free png format.
                              If you find an old version you can try to compile and link to the php... but I think it's a hard work.
                              A more fast solution to this problem, but less efficient is to use the fly program. It has compiled with an old version of GIF file and it supports GIF format.

                              http://martin.gleeson.com/fly/

                                 With php I dinamically create a text file with the instructions to modify the image, then I call fly 

                              exec("fly -i ".$InputFileName." -o ".$OutputFileName." -q");
                              If you have problem you can try with the system instruction.

                              I hope it's usefull for you

                              Bye

                              Sergio

                                a month later

                                I have exactly the same problem. I've installed all the latest .dll files, etc. but when I try to use the function imagepng() to write to a file, I get that same error message: Unknown list entry type in request shutdown.

                                Strangely enough, directly outputting an image, without writing to a file, works no problem, i.e.

                                imagepng ($img); // works
                                imagepng ($img, "img.png"); // doesn't work

                                Is this because the GD library doesn't support writing PNG files? Or am I just doing something stupid?

                                  2 years later

                                  Scott,
                                  I'm having trouble installing gd on Red Hat 7.1 I made all the separate libs, I've even made freetype and zlib, but it's throwing errors on config when it gets to Xpm.

                                  i'm running this:
                                  ./configure --with-gd=../gd-2.0.1 --with-jpeg-dir=../jpeg-6b --with-png-dir=../libpng-1.2.1 --with-freetype-dir=../freetype-2.0.8 --with-xpm-dir=../xpm-3.4k --with-zlib-dir=../zlib-1.1.3

                                  and it's giving me this:

                                  checking for the location of libjpeg... yes
                                  checking for jpeg_read_header in -ljpeg... yes
                                  checking for the location of libpng... yes
                                  checking for png_info_init in -lpng... yes
                                  checking for the location of libXpm... yes
                                  checking for XpmFreeXpmImage in -lXpm... no
                                  configure: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.

                                  any thoughts would be most appreciated!

                                  thank you in advance.

                                    Write a Reply...