Please help with GD library .. how do I activate this thing??

Discussion in 'PHP' started by steveallen, May 8, 2006.

  1. #1
    Can anyone help me get GD library up and running?

    I run the following:
    Apache 1.3.33
    MySql 3.23.49
    PHP 4.3.4

    From the <?php phpinfo(); ?> it says I have GD support 'enabled'. These details are displayed:

    GD Support enabled
    GD Version bundled (2.0.15 compatible)
    FreeType Support enabled
    FreeType Linkage with freetype
    T1Lib Support enabled
    GIF Read Support enabled
    JPG Support enabled
    PNG Support enabled
    WBMP Support enabled
    XBM Support enabled

    However, when I attempt a basic sample 'GD' script to test it .. just a blank page displays (no error message though).

    Is there something further I need to do in the php.ini or http.conf files to activate this thing?

    Any help would be appreciated!!

    Steve
     
    steveallen, May 8, 2006 IP
  2. steveallen

    steveallen Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    oops .. forgot to mention ... I am on Mac osx V.4 (Tiger)

    Steve
     
    steveallen, May 8, 2006 IP
  3. ideas_man

    ideas_man Active Member

    Messages:
    212
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Well if it says its installed in phpinfo() then I don't think there is anything else you need to do. If there was a problem, you would get error messages for undefined functions when you used them.

    However, to be thorough, check that the following is uncommented in php.ini:

    
    extension=php_gd.dll
    
    Code (markup):
    Actually check that you have this .dll in your php installation.

    Since you are getting no errors, I would perhaps look first at your script... is it actually outputting anything to the browser? I know you are not seeing anything, but have you written anything in the script to actually output?

    That would be my first guess.Using a function like imagepng() will output the image you created to browser.eg.

    
    imagepng($image_handle);
    
    Code (markup):
    You may also want to send a Content-type header before you output.

    Hope this helps :)
     
    ideas_man, May 9, 2006 IP
  4. ideas_man

    ideas_man Active Member

    Messages:
    212
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #4
    I just did a quick search about Mac problems with the GD library and found :

    I have no experience with Macs so if this is the problem, I can't help you unfortunately, but perhaps someone else will chip in :) A quick search gave me the section above from :

    http://developer.apple.com/internet/opensource/php.html

    Hope this helps :)
     
    ideas_man, May 9, 2006 IP
  5. steveallen

    steveallen Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    much appreciated!
     
    steveallen, May 9, 2006 IP
  6. tech86

    tech86 Peon

    Messages:
    83
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Check phpfreaks.com they have a great guide on it for basic coding
     
    tech86, May 11, 2006 IP
  7. cjohnweb

    cjohnweb Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I am not sure if this would help you, but as I understand it you simply want to get PHP to output an image, correct?

    I have a little tool I wrote in PHP on my blog, a single file with no need for configuration or anything....If you have the GD image library working it will place text into an image, depending on the TTF provided.

    It has samples, and a code generator and another script I found to add reflection to the bottom of the image for really nice headers and things of the like....

    Anyways, its a small file so if you want to check it out:
    http://iluvjohn.com/welcome-to-iluvjohn/custom-fonts-on-a-website-with-php-704/
     
    cjohnweb, Jul 24, 2010 IP
  8. VariousWays

    VariousWays Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #8
    Maybe you can try to enable errors and set the Content-Type to text/plain:


    
    <?
    
    header("Content-Type: text/plain");
    error_reporting(E_ALL);
    ini_set("error_reporting", E_ALL);
    
    ?>
    
    PHP:
    This should provide you with some additional info.
     
    VariousWays, Jul 26, 2010 IP