Results 1 to 10 of 10

Thread: Installing the GD Library

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Installing the GD Library

    I'm absolutely clueless as to how to do this. Any help?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  2. #2
    Mabe this link will be helpful: http://php.weblogs.com/php_gd

    Unzip the file php_gd_gif.dll and rename to php_gd.dll. Copy to your extensions directory, update your PHP.ini file to extension=php_gd.dll.

  3. #3

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    This may sound stupid...but I can't find my php.ini file.

    I thought I put it in my C:\WINDOWS directory, but it's not there.

    I searched for it, and the search returned nothing.

    Yet PHP runs, fine.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Eh, well, I put another copy of php.ini in C:\WINDOWS, so hopefully I wont have a problem.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    If you don't have your PHP INI file installed correctly, PHP just runs off of the default settings. I don't have anything to change in it, so I don't even use it.
    Like Archer? Check out some Sterling Archer quotes.

  6. #6

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Ah. Maybe when I installed XP I just forgot to add it to the Windows directory. I probably thought "It works...I must be done!" And didn't even think about the .ini.

    I'm still confused as to how to get this working. That link was for PHP 4.0 and I don't think it was version 2 of the GD library.

    Do I have to download it from their site and build it myself?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    PHP should already come with it.. I don't know which version PHP is on right now, but the version I have (4.3.1 I think) came with GD 2.0 as far as I know.

    you shouldn't have to do anything to make it work, and the most you should have to do is uncomment the GD library entry in your PHP INI.
    Like Archer? Check out some Sterling Archer quotes.

  8. #8

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I was running 4.3.1 or something like that, and I didn't have the GD library. I uncommented the line, but it didn't work. the php_gd2.dll wasn't even on my computer.

    So I downloaded 4.3.3 and installed it...still, no GDI library.

    I was downloading the windows installer, so I decided to download the zip. The php_gd2.dll file was in there, so I unziped that file and put it in a php/extensions directory and changed my extensions directory to that in the ini and it works.

    Now I can't figure out how to use the friggin' functions. I get no errors, but I also get no images.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  9. #9
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    yeah, i've never downloaded the installer.. just the zip.

    post some code of what you're doing.. or, here, i'll just give you some that i know works, to see if it works at all..

    PHP Code:
    <?
    Header("Content-type: image/png");

    $image = imageCreate(100,40);

    $white = imageColorAllocate($image,255,255,255);
    $black = imageColorAllocate($image,0,0,0);

    imageFilledRectangle($image, 0, 0, 100, 40, $white);

    $font = "verdana.TTF";
    $text = "test";

    imagettftext ($image, 20, 0, 15, 33, $black, $font, $text);

    imagePNG($image);
    imageDestroy($image);
    ?>
    just move verdana.ttf into that folder the script is in..
    Like Archer? Check out some Sterling Archer quotes.

  10. #10

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I think I got my code working. Thanks.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width