Solved

Compiling GD with PHP

Posted on 2001-08-03
13
2,933 Views
Last Modified: 2012-05-04
I grabbed the latest GD source and compiled it using

make; make install;

then I reconfigured PHP using this line

./configure --with-mysql=/usr/local/mysql --with-config-file-path=/www/conf --with-apache=../httpd -enable-track-vars --with-gd=/path/to/gd

followed by a make; make install. This worked ok and I got no errors. then I went to my apache directory and recompiled that to use the new php module, so I did

cd /path/to/apache
make

this is where I got the errors

/usr/local/etc/php/ext/gd/gd_ctx.c:61: undefined reference to `gdNewFileCtx'
modules/php4/libphp4.a(gd.o): In function `php_if_imagesetstyle':
/usr/local/etc/php/ext/gd/gd.c:552: undefined reference to `gdImageSetStyle'
modules/php4/libphp4.a(gd.o): In function `php_if_imagesettile':
/usr/local/etc/php/ext/gd/gd.c:916: undefined reference to `gdImageSetTile'
modules/php4/libphp4.a(gd.o): In function `php_if_imagesetbrush':
/usr/local/etc/php/ext/gd/gd.c:942: undefined reference to `gdImageSetBrush'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecreate':
/usr/local/etc/php/ext/gd/gd.c:967: undefined reference to `gdImageCreate'
modules/php4/libphp4.a(gd.o): In function `_php_image_create_from_string':
/usr/local/etc/php/ext/gd/gd.c:1032: undefined reference to `gdNewDynamicCtx'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecreatefromstring':
/usr/local/etc/php/ext/gd/gd.c:1074: undefined reference to `gdImageCreateFromJpegCtx'
/usr/local/etc/php/ext/gd/gd.c:1083: undefined reference to `gdImageCreateFromPngCtx'
/usr/local/etc/php/ext/gd/gd.c:1101: undefined reference to `gdImageCreateFromWBMPCtx'
modules/php4/libphp4.a(gd.o): In function `_php_image_create_from':
/usr/local/etc/php/ext/gd/gd.c:1181: undefined reference to `gdNewDynamicCtx'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecreatefromjpeg':
/usr/local/etc/php/ext/gd/gd.c:1222: undefined reference to `gdImageCreateFromJpegCtx'
/usr/local/etc/php/ext/gd/gd.c:1222: undefined reference to `gdImageCreateFromJpeg'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecreatefrompng':
/usr/local/etc/php/ext/gd/gd.c:1235: undefined reference to `gdImageCreateFromPngCtx'
/usr/local/etc/php/ext/gd/gd.c:1235: undefined reference to `gdImageCreateFromPng'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecreatefromwbmp':
/usr/local/etc/php/ext/gd/gd.c:1278: undefined reference to `gdImageCreateFromWBMPCtx'
/usr/local/etc/php/ext/gd/gd.c:1278: undefined reference to `gdImageCreateFromWBMP'
modules/php4/libphp4.a(gd.o): In function `php_if_imagepng':
/usr/local/etc/php/ext/gd/gd.c:1419: undefined reference to `gdImagePngCtx'
modules/php4/libphp4.a(gd.o): In function `php_if_imagejpeg':
/usr/local/etc/php/ext/gd/gd.c:1437: undefined reference to `gdImageJpegCtx'
modules/php4/libphp4.a(gd.o): In function `php_if_imagewbmp':
/usr/local/etc/php/ext/gd/gd.c:1454: undefined reference to `gdImageWBMPCtx'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolorallocate':
/usr/local/etc/php/ext/gd/gd.c:1504: undefined reference to `gdImageColorAllocate'
modules/php4/libphp4.a(gd.o): In function `php_if_imagepalettecopy':
/usr/local/etc/php/ext/gd/gd.c:1525: undefined reference to `gdImagePaletteCopy'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolorat':
/usr/local/etc/php/ext/gd/gd.c:1552: undefined reference to `gdImageBoundsSafe'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolorclosest':
/usr/local/etc/php/ext/gd/gd.c:1584: undefined reference to `gdImageColorClosest'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolorclosesthwb':
/usr/local/etc/php/ext/gd/gd.c:1608: undefined reference to `gdImageColorClosestHWB'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolordeallocate':
/usr/local/etc/php/ext/gd/gd.c:1636: undefined reference to `gdImageColorDeallocate'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolorresolve':
/usr/local/etc/php/ext/gd/gd.c:1664: undefined reference to `gdImageColorResolve'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolorexact':
/usr/local/etc/php/ext/gd/gd.c:1687: undefined reference to `gdImageColorExact'
modules/php4/libphp4.a(gd.o): In function `php_if_imagesetpixel':
/usr/local/etc/php/ext/gd/gd.c:1809: undefined reference to `gdImageSetPixel'
modules/php4/libphp4.a(gd.o): In function `php_if_imageline':
/usr/local/etc/php/ext/gd/gd.c:1836: undefined reference to `gdImageLine'
modules/php4/libphp4.a(gd.o): In function `php_if_imagedashedline':
/usr/local/etc/php/ext/gd/gd.c:1862: undefined reference to `gdImageDashedLine'
modules/php4/libphp4.a(gd.o): In function `php_if_imagerectangle':
/usr/local/etc/php/ext/gd/gd.c:1889: undefined reference to `gdImageRectangle'
modules/php4/libphp4.a(gd.o): In function `php_if_imagefilledrectangle':
/usr/local/etc/php/ext/gd/gd.c:1916: undefined reference to `gdImageFilledRectangle'
modules/php4/libphp4.a(gd.o): In function `php_if_imagearc':
/usr/local/etc/php/ext/gd/gd.c:1951: undefined reference to `gdImageArc'
modules/php4/libphp4.a(gd.o): In function `php_if_imagefilltoborder':
/usr/local/etc/php/ext/gd/gd.c:1977: undefined reference to `gdImageFillToBorder'
modules/php4/libphp4.a(gd.o): In function `php_if_imagefill':
/usr/local/etc/php/ext/gd/gd.c:2002: undefined reference to `gdImageFill'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecolortransparent':
/usr/local/etc/php/ext/gd/gd.c:2054: undefined reference to `gdImageColorTransparent'
modules/php4/libphp4.a(gd.o): In function `php_if_imageinterlace':
/usr/local/etc/php/ext/gd/gd.c:2089: undefined reference to `gdImageInterlace'
modules/php4/libphp4.a(gd.o): In function `php_imagepolygon':
/usr/local/etc/php/ext/gd/gd.c:2152: undefined reference to `gdImageFilledPolygon'
/usr/local/etc/php/ext/gd/gd.c:2154: undefined reference to `gdImagePolygon'
modules/php4/libphp4.a(gd.o): In function `php_find_gd_font':
/usr/local/etc/php/ext/gd/gd.c:2190: undefined reference to `gdFontSmall'
/usr/local/etc/php/ext/gd/gd.c:2193: undefined reference to `gdFontMediumBold'
/usr/local/etc/php/ext/gd/gd.c:2196: undefined reference to `gdFontLarge'
/usr/local/etc/php/ext/gd/gd.c:2205: undefined reference to `gdFontTiny'
/usr/local/etc/php/ext/gd/gd.c:2207: undefined reference to `gdFontGiant'
modules/php4/libphp4.a(gd.o): In function `php_gdimagecharup':
/usr/local/etc/php/ext/gd/gd.c:2269: undefined reference to `gdImageSetPixel'
modules/php4/libphp4.a(gd.o): In function `php_imagechar':
/usr/local/etc/php/ext/gd/gd.c:2323: undefined reference to `gdImageChar'
/usr/local/etc/php/ext/gd/gd.c:2330: undefined reference to `gdImageChar'
/usr/local/etc/php/ext/gd/gd.c:2338: undefined reference to `gdImageCharUp'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecopy':
/usr/local/etc/php/ext/gd/gd.c:2414: undefined reference to `gdImageCopy'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecopymerge':
/usr/local/etc/php/ext/gd/gd.c:2454: undefined reference to `gdImageCopyMerge'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecopymergegray':
/usr/local/etc/php/ext/gd/gd.c:2498: undefined reference to `gdImageCopyMergeGray'
modules/php4/libphp4.a(gd.o): In function `php_if_imagecopyresized':
/usr/local/etc/php/ext/gd/gd.c:2545: undefined reference to `gdImageCopyResized'
modules/php4/libphp4.a(gd.o): In function `_php_image_bw_convert':
/usr/local/etc/php/ext/gd/gd.c:3253: undefined reference to `gdImageCreate'
/usr/local/etc/php/ext/gd/gd.c:3258: undefined reference to `gdImageColorAllocate'
/usr/local/etc/php/ext/gd/gd.c:3264: undefined reference to `gdImageColorAllocate'
/usr/local/etc/php/ext/gd/gd.c:3272: undefined reference to `gdImageGetPixel'
/usr/local/etc/php/ext/gd/gd.c:3280: undefined reference to `gdImageSetPixel'
modules/php4/libphp4.a(gd.o): In function `_php_image_convert':
/usr/local/etc/php/ext/gd/gd.c:3371: undefined reference to `gdImageCreateFromJpeg'
/usr/local/etc/php/ext/gd/gd.c:3382: undefined reference to `gdImageCreateFromPng'
/usr/local/etc/php/ext/gd/gd.c:3425: undefined reference to `gdImageCreate'
/usr/local/etc/php/ext/gd/gd.c:3431: undefined reference to `gdImageCopyResized'
/usr/local/etc/php/ext/gd/gd.c:3433: undefined reference to `gdImageDestroy'
/usr/local/etc/php/ext/gd/gd.c:3437: undefined reference to `gdImageCreate'
/usr/local/etc/php/ext/gd/gd.c:3442: undefined reference to `gdImageColorAllocate'
/usr/local/etc/php/ext/gd/gd.c:3448: undefined reference to `gdImageColorAllocate'
/usr/local/etc/php/ext/gd/gd.c:3458: undefined reference to `gdImageGetPixel'
/usr/local/etc/php/ext/gd/gd.c:3466: undefined reference to `gdImageSetPixel'
/usr/local/etc/php/ext/gd/gd.c:3470: undefined reference to `gdImageDestroy'
/usr/local/etc/php/ext/gd/gd.c:3472: undefined reference to `gdImageWBMP'
/usr/local/etc/php/ext/gd/gd.c:3477: undefined reference to `gdImageDestroy'
modules/php4/libphp4.a(gd.o): In function `php_free_gd_image':
/usr/local/etc/php/ext/gd/gd.c:236: undefined reference to `gdImageDestroy'
modules/php4/libphp4.a(gd.o): In function `_php_image_bw_convert':
/usr/local/etc/php/ext/gd/gd.c:3284: undefined reference to `gdImageWBMPCtx'
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/usr/local/etc/apache_1.3.20/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/local/etc/apache_1.3.20'
make: *** [build] Error 2

I am using Red Hat Linux 7.1, Apache 1.3.20, PHP 4.0.6 and Mysql 3.23.39

Anyone got any ideas why I get these errors ?

Thanks
0
Comment
Question by:Gareth_Hastings
13 Comments
 
LVL 15

Expert Comment

by:a.marsh
Comment Utility
What version of the gd library are you using?

Ant
0
 
LVL 1

Author Comment

by:Gareth_Hastings
Comment Utility
I'm using GD 1.8.4
0
 

Expert Comment

by:cynicz
Comment Utility
isn't there a stale gd.h somewhere on that system?
0
 
LVL 1

Author Comment

by:Gareth_Hastings
Comment Utility
well I did a locate gd.h and got this

/home/downloads/php/gd-1.8.4/gd.h
/usr/include/gd.h
/usr/local/etc/php-4.0.6/ext/gd/php_gd.h
/usr/local/include/gd.h

so which do I want ? /home/downloads/php/gd-1.8.4/gd.h ? and should I just deleted all the others ?
0
 

Expert Comment

by:cynicz
Comment Utility
how did you install the version you compiled yourself?
0
 
LVL 1

Author Comment

by:Gareth_Hastings
Comment Utility
err, I just did

make; make install
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Expert Comment

by:cynicz
Comment Utility
you mean you didn't run ./configure? ... hm...
I guess that's not the case, and software is commonly installed in /usr/local/, so it's probably in there. but to make sure, do

./configure --help | grep prefix

in the gd source directory. that should tell you where it's installed. once you have the info, get rid of the other gd.h files (you can double check by reading the gd.h file, it might tell you what version it is), and then reconfigure php:
$ rm -f config.cache
$ ./configure --with-mysql=/usr/local/mysql --with-config-file-path=/www/conf --with-apache=../httpd -enable-track-vars --with-gd=/usr/local

BTW, I'm not familiar with Linux, but on FreeBSD the /usr/local/etc/ directory is used for configuration scripts, not software. read hier(7):
$ man 7 hier
0
 
LVL 1

Author Comment

by:Gareth_Hastings
Comment Utility
GD 1.8.4 doesn't come with a configure script, the readme just says to run make and make install :/
0
 

Expert Comment

by:cynicz
Comment Utility
doesn't it say where it's installed? you can find out if you read the make file. but I guess it'll be in /usr/local. I suggest you just follow the instructions I gave you earlier.
0
 
LVL 1

Expert Comment

by:larry718
Comment Utility
try this linkie, i have set it up with no problems.

httpd://www.linuxguruz.org/z.php?id=32&h=php+mysql+apache
0
 

Expert Comment

by:Ganet
Comment Utility
how about using php ver 4.3.0 and running

./configure --with-mysql=/usr/local/mysql --with-config-file-path=/www/conf --with-apache=../httpd -enable-track-vars --with-gd --with-zlib

then make and make install

then recompile apache and you shouldn't have a problem
0
 
LVL 5

Expert Comment

by:LornaJane
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ/No refund
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

LornaJane
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed - no points refunded (of 300)

Computer101
E-E Admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now