I've done everything but it's not working at all.
Apache 1.3.11, php4 on W98
Could you mail me exactly what I have to do?

Thank you very much

    I have already posted all the steps to install gd lib on win98(Apache as server).
    explain me how you proceed step by step.
    rohit

      I have already posted all the steps to install gd lib on win98(Apache as server).
      explain me how you proceed step by step.
      rohit

        Hi

        I downloaded all files from http://download.swwwing.com/php4/modules/
        and instaled to my php4 directory. Then I also downloaded phpts.exe and php4ts.dll from http://download.swwwing.com/php4/core/.
        Next step was that I moved msvcrt.dll and php4ts to c:\windows\system directory.
        Also I made changes to httpd.conf file
        Action application/x-httpd-php "/php/phpts.exe". I'm trying to run litle php script
        <?

        header("Content-type: image/gif");
        $string = implode($argv, " ");
        $im = ImageCreateFromGif("headera.gif");
        $orange = ImageColorAllocate($im, 220, 210, 60);
        $px = (imagesx($im) -7.5*strlen($string))/2;
        ImageString($im, 3, $px, 9, $string, $orange);
        ImageGif($im);
        ImageDestroy($im);

        ?>
        but I get error message something like this
        <b>Warning</b>: ImageCreateFromGif: No GIF support in this PHP build in <b>c:\web\test\gdtest.php</b> on line <b>5</b><br>
        <br>
        <b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>6</b><br>
        <br>
        <b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>7</b><br>
        <br>
        <b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>8</b><br>
        <br>
        <b>Warning</b>: ImageGif: No GIF support in this PHP build in <b>c:\web\test\gdtest.php</b> on line <b>9</b><br>
        <br>
        <b>Warning</b>: Supplied argument is not a valid Image resource in <b>c:\web\test\gdtest.php</b> on line <b>10</b><br>

        Can you help me ?

        Thank You

          we are using 1.8+ gd lib which does not
          support gif images
          so use jpg.
          try it
          <?

          header("Content-type: image/jpeg");
          $string = implode($argv, " ");
          $im = ImageCreateFromJpeg("headera.jpg");
          $orange = ImageColorAllocate($im, 220, 210, 60);
          $px = (imagesx($im) -7.5*strlen($string))/2;
          ImageString($im, 3, $px, 9, $string, $orange);
          ImageJpeg($im);
          ImageDestroy($im);

          ?>
          best of luck

            Thank You !!!!

            Now it's working !!!!

            Do you know where gd lib will support gif images ? I'm asking because 90% of images I'm using are in gif format.

            Thanks again !!!!

            DAN

              i don't tried for that but u can download
              1.6 gd lib from bourtel.com and then compile it.

                can u give me url to that 1.6 version?
                bourtel.com is not working
                Dan

                  One more question.

                  I need to rotate text 90 deg to left.
                  I tried to use script I desribed before.
                  I passed text as a argument. With your help it's done. Problem is rotation !!
                  Any ideas? I will appreciate it.

                  Dan

                    Hi,

                    GD lib is seems to work just fine for JPEG images, but not for PNG. When I try to load an PNG image, I always get the CGI program Error message that is error in phpts.exe.

                    Here is the demo code:

                    <?php

                    LoadJpeg( "sample.jpg" );
                    //LoadJpeg( "sample.png" );

                    function LoadPNG ( $imgname ) {
                    $im = @ImageCreateFromPNG ($imgname); // Attempt to open
                    if (!$im) { // See if it failed
                    $im = ImageCreate (150, 30); // Create a blank image
                    $bgc = ImageColorAllocate ($im, 255, 255, 255);
                    $tc = ImageColorAllocate ($im, 0, 0, 0);
                    ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
                    // Output an errmsg
                    ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
                    }
                    ImagePNG( $im );
                    }

                    function LoadJpeg ( $imgname ) {
                    $im = @ImageCreateFromJpeg ($imgname); // Attempt to open
                    if (!$im) { // See if it failed
                    $im = ImageCreate (150, 30); // Create a blank image
                    $bgc = ImageColorAllocate ($im, 255, 255, 255);
                    $tc = ImageColorAllocate ($im, 0, 0, 0);
                    ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
                    // Output an errmsg
                    ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
                    }
                    ImageJpeg( $im );
                    }

                    ?>

                      Uff,

                      I made a mistake in code above. The php code should be:

                      <?php

                      //LoadJpeg( "sample.jpg" );
                      LoadPng( "sample.png" );

                      function LoadPNG ( $imgname ) {
                      $im = @ImageCreateFromPNG ($imgname); // Attempt to open
                      if (!$im) { // See if it failed
                      $im = ImageCreate (150, 30); // Create a blank image
                      $bgc = ImageColorAllocate ($im, 255, 255, 255);
                      $tc = ImageColorAllocate ($im, 0, 0, 0);
                      ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
                      // Output an errmsg
                      ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
                      }
                      ImagePNG( $im );
                      }

                      function LoadJpeg ( $imgname ) {
                      $im = @ImageCreateFromJpeg ($imgname); // Attempt to open
                      if (!$im) { // See if it failed
                      $im = ImageCreate (150, 30); // Create a blank image
                      $bgc = ImageColorAllocate ($im, 255, 255, 255);
                      $tc = ImageColorAllocate ($im, 0, 0, 0);
                      ImageFilledRectangle ($im, 0, 0, 150, 30, $bgc);
                      // Output an errmsg
                      ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc);
                      }
                      ImageJpeg( $im );
                      }

                      ?>

                      I'm always getting a CGI application error message!

                      Simon

                        3 months later
                        Write a Reply...