Solved

Compiling GD with PHP

Posted on 2001-08-03
13
2,958 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6351380
What version of the gd library are you using?

Ant
0
 
LVL 1

Author Comment

by:Gareth_Hastings
ID: 6351928
I'm using GD 1.8.4
0
 

Expert Comment

by:cynicz
ID: 6352549
isn't there a stale gd.h somewhere on that system?
0
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 1

Author Comment

by:Gareth_Hastings
ID: 6352762
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
ID: 6352763
how did you install the version you compiled yourself?
0
 
LVL 1

Author Comment

by:Gareth_Hastings
ID: 6353430
err, I just did

make; make install
0
 

Expert Comment

by:cynicz
ID: 6353818
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
ID: 6355055
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
ID: 6358858
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
ID: 6407306
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
ID: 7974246
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
ID: 9571467
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
ID: 9619927
PAQed - no points refunded (of 300)

Computer101
E-E Admin
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

623 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