1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP GD Jpeg Support

Discussion in 'PHP' started by nevetS, Oct 7, 2005.

  1. #1
    So I just spent two hours figuring this out. I thought I would post about it since googling did not yield me any assistance although there are plenty of people having the problem I was having.

    The problem:
    A series of errors about undefined references to functions such as gdImageRotate and gdImageEllipse when trying to compile php against an external gd library (as opposed to the internal one) with jpeg support.
    
    ext/gd/gd.lo(.text+0x1267): In function `zif_imagecolormatch':
    /usr/local/directadmin/customapache/php-4.3.9/ext/gd/gd.c:807:
    undefined reference to `gdImageColorMatch'
    ext/gd/gd.lo(.text+0x2cd4): In function `zif_imagerotate':
    /usr/local/directadmin/customapache/php-4.3.9/ext/gd/gd.c:1117:
    undefined reference to `gdImageRotate'
    ext/gd/gd.lo(.text+0x5bf5): In function `zif_imageline':
    /usr/local/directadmin/customapache/php-4.3.9/ext/gd/gd.c:2189:
    undefined reference to `gdImageAALine'
    ext/gd/gd.lo(.text+0x6c7c): In function `zif_imageellipse':
    /usr/local/directadmin/customapache/php-4.3.9/ext/gd/gd.c:2322:
    undefined reference to `gdImageEllipse'
    ext/gd/gd.lo(.text+0x9d68): In function `zif_imageantialias':
    /usr/local/directadmin/customapache/php-4.3.9/ext/gd/gd.c:3883:
    undefined reference to `gdImageAntialias' 
    
    PHP:
    The solution:
    I did a few things that finally resolved the problem, which resolved it I'm not sure:
    1) "make clean" before "make" (maybe the problem was because I had previously compiled with the internal gd library)
    2) added the configuration parameter --with-jpeg (documentation only states to include --with-jpeg-dir=/usr/local/)

    I was at my wits end when I finally found the solution - and it's not a real revelation or stroke of genious so that's probably why there aren't many solutions posted.

    Hope this helps someone out in the future.
     
    nevetS, Oct 7, 2005 IP
  2. ole_v2

    ole_v2 Member

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Thanks nevetS!

    Look. I registered especially to thank you for this post.
     
    ole_v2, Jul 4, 2007 IP
  3. CodyRo

    CodyRo Peon

    Messages:
    365
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This thread is ancient o.o!
     
    CodyRo, Jul 4, 2007 IP