Re: [PHP3] gd / png / php3. (fwd)

From: Date: Tue, 15 Feb 2000 21:45:43 +0000
Subject: Re: [PHP3] gd / png / php3. (fwd)
Groups: php.dev 
Request: Send a blank email to php-dev+get-15550@lists.php.net to get a copy of this message
er, php3-dev = php-dev. -tcl. ---------- Forwarded message ---------- Date: Tue, 15 Feb 2000 16:37:36 -0500 (EST) From: tc lewis <tim@hostme.com> To: rasmus@php.net Cc: php3-dev@lists.php.net, php3@lists.php.net, markonen@php.net, tc lewis <tim@hostme.com> Subject: Re: [PHP3] gd / png / php3. i just got the current php3 snapshot (not php4), and the results are similar, but slightly different: Fatal error: Call to unsupported or undefined function imagecreate() in /usr/webservers/https-web99/htdocs/pngtest.php on line 2 hmm, ok, check this out: php 3.0.14 distribution: [root@web99 php-3.0.14]# ./configure --with-apxs=/usr/webservers/https-web99/bin/apxs --with-config-file-path=/usr/webservers/https-web99/conf --with-gd --with-mysql --with-pgsql=/usr --with-ttf --with-x --with-ldap --with-snmp --with-xml --with-zlib --with-gdbm --with-db2 | grep -i gd checking for gdbm_open in -lgdbm... (cached) yes checking preferred dbm library... gdbm chosen checking for gdbm.h... (cached) yes checking whether to include GD support... yes checking for gdImageLzw in -lgd... (cached) no checking for gdImageCreateFromPng in -lgd... (cached) no checking for gdImageCreateFromGif in -lgd... (cached) no checking for gdImageColorResolve in -lgd... (cached) no checking for gdImageGif in -lgd... (cached) no checking for gdImageCopyMerge in -lgd... (cached) no checking for gdImageGifToSink in -lgd... (cached) no checking for gdImageString16 in -lgd... (cached) no checking whether to enable t1lib support with GD... no checking for gdbm_open in -lgdbm... yes checking for GDBM support... yes creating extra/gd/bdf2gdfont php3 snapshot: [root@web99 php3]# ./configure --with-apxs=/usr/webservers/https-web99/bin/apxs --with-config-file-path=/usr/webservers/https-web99/conf --with-gd --with-mysql --with-pgsql=/usr --with-ttf --with-x --with-ldap --with-snmp --with-xml --with-zlib --with-gdbm --with-db2 | grep -i gd checking for gdbm_open in -lgdbm... (cached) yes checking preferred dbm library... gdbm chosen checking for gdbm.h... (cached) yes checking for gdImageCreateFromPng in -lgd... (cached) no checking for gdImageCreateFromGif in -lgd... (cached) no checking for gdImageLzw in -lgd... (cached) no checking for gdImageColorResolve in -lgd... (cached) no checking for gdImageString16 in -lgd... (cached) no checking whether to include GD support... no configure: warning: No gd support found. Skipping FreeType Configuration checking for gdbm_open in -lgdbm... yes checking for GDBM support... yes creating extra/gd/bdf2gdfont [root@web99 /root]# rpm -q gd gd-devel gd-1.7.3-1 gd-devel-1.7.3-1 i think what's happening here is that my gd is linked against png, ttf, and Xpm, so if configure checks for gdImageCreateFromPng() against just -lgd or -lgd -lpng, it will fail. it needs -lgd -lpng -lttf -L/usr/X11R6/lib -lXpm -lX11 to successfully compile something to properly use gdImageCreateFromPng(). for example: [root@web99 /root]# cat testgd.c #include <gd.h> int main(int argc, char *argv[]) { gdImagePtr nog; nog = gdImageCreateFromPng(NULL); return 0; } (yes the NULL is bad). [root@web99 /root]# gcc -o testgd testgd.c -lgd -lpng /usr/lib/libgd.so: undefined reference to `TT_New_Glyph' /usr/lib/libgd.so: undefined reference to `TT_Load_Glyph' /usr/lib/libgd.so: undefined reference to `TT_Get_Instance_Metrics' /usr/lib/libgd.so: undefined reference to `TT_New_Instance' /usr/lib/libgd.so: undefined reference to `TT_Get_CharMap_ID' /usr/lib/libgd.so: undefined reference to `TT_Get_Glyph_Metrics' /usr/lib/libgd.so: undefined reference to `TT_Set_Instance_Resolutions' /usr/lib/libgd.so: undefined reference to `TT_Get_Glyph_Pixmap' /usr/lib/libgd.so: undefined reference to `TT_Close_Face' /usr/lib/libgd.so: undefined reference to `TT_Get_Glyph_Outline' /usr/lib/libgd.so: undefined reference to `TT_Get_Face_Properties' /usr/lib/libgd.so: undefined reference to `TT_Transform_Outline' /usr/lib/libgd.so: undefined reference to `TT_Open_Face' /usr/lib/libgd.so: undefined reference to `TT_Init_FreeType' /usr/lib/libgd.so: undefined reference to `TT_Char_Index' /usr/lib/libgd.so: undefined reference to `TT_Done_Instance' /usr/lib/libgd.so: undefined reference to `TT_Get_CharMap_Count' /usr/lib/libgd.so: undefined reference to `TT_Set_Instance_CharSize' /usr/lib/libgd.so: undefined reference to `TT_Get_CharMap' /usr/lib/libgd.so: undefined reference to `TT_Get_Glyph_Bitmap' /usr/lib/libgd.so: undefined reference to `TT_Done_Glyph' /usr/lib/libgd.so: undefined reference to `XpmReadFileToXpmImage' collect2: ld returned 1 exit status [root@web99 /root]# gcc -o testgd testgd.c -lgd -lpng -lttf -L/usr/X11R6/lib -lXpm -lX11 [root@web99 /root]# am i on the right track here? unfortunately i'm rather configure-script-illiterate. if anyone could suggest the proper way to "fix" this, i would appreciate it. i mentioned before about how i manually add -lpng -L/usr/X11R6/lib -lXpm -lX11 to my APXS_LDFLAGS so my apache doesn't fail to start post-configure, but i didn't catch before that it wasn't including the proper gd support because of this at an earlier stage...frown. here's what i did to hack it to work: perl -pi -e 's/LIBS="-lgd/LIBS="-lgd -lpng -lttf -L\/usr\/X11R6\/lib -lXpm -lX11/g' configure and then: [root@web99 php-3.0.14]# ./configure --with-apxs=/usr/webservers/https-web99/bin/apxs --with-config-file-path=/usr/webservers/https-web99/conf --with-gd --with-mysql --with-pgsql=/usr --with-ttf --with-x --with-ldap --with-snmp --with-xml --with-zlib --with-gdbm --with-db2 | grep -i gd checking for gdbm_open in -lgdbm... (cached) no checking whether to include GD support... yes checking for gdImageLzw in -lgd... (cached) no checking for gdImageCreateFromPng in -lgd... (cached) yes checking for gdImageCreateFromGif in -lgd... (cached) no checking for gdImageColorResolve in -lgd... (cached) yes checking for gdImageGif in -lgd... (cached) no checking for gdImageCopyMerge in -lgd... (cached) yes checking for gdImageGifToSink in -lgd... (cached) no checking for gdImageString16 in -lgd... (cached) yes checking whether to enable t1lib support with GD... no checking for gdbm_open in -lgdbm... no checking for GDBM support... yes creating extra/gd/bdf2gdfont i still need to append "-L/usr/X11R6/lib -lXpm -lX11" to APXS_LDFLAGS in the Makefile then, but after that and a build and install...it works! woo! that can't be used for everyone tho, since not everyone uses a gd built against ttf and Xpm. there must be a way to check for that somehow and adjust the configure script accordingly, no? -tcl. On Tue, 15 Feb 2000 rasmus@php.net wrote: > Try a snapshot from snaps.php.net and let us know if the problem is fixed. > > On Tue, 15 Feb 2000, tc lewis wrote: > > > > > i'm having a similar problem as found in bug id #3374 at bugs.php.net > > http://bugs.php.net/bugs.php3?id=3374&edit=1 > > > > i'm using apache 1.3.11, php 3.0.14, and gd 1.7.3 (1.7.3-1 contributed > > source rpm) on a redhat-6.1 based platform with a rebuilt 2.2.14 kernel > > and a rebuilt apache from scratch and blah blah. i am compiling php at a > > dso along with some other apache modules. > > > > anyway, this gd obviously doesn't support the gif type, so that's out. > > and that's fine. but imagepng() doesn't seem to function properly either. > > > > here's the php i'm using to test: > > [root@web16 htdocs]# cat pngtest.php > > <? > > $img = ImageCreate(100, 100); > > $red = ImageColorAllocate($img, 255, 0, 0); > > ImageLine($img, 0, 0, 99, 99, $red); > > /* Show & destroy an image */ > > Header( "Content-type: image/png"); > > ImagePng($img); > > ImageDestroy($img); > > ?> > > > > on the web it creates html containing: > > "<br> > > <b>Fatal error</b>: Call to unsupported or undefined function imagepng() in > > <b>/usr/webservers/https-web16/htdocs/pngtest.php</b> on line > > <b>7</b><br>" > > > > i've configured php with: > > > > ./configure --with-apxs=/usr/webservers/https-web16/bin/apxs > > --with-config-file-path=/usr/webservers/https-web16/conf --with-gd --with-mysql --with-pgsql=/usr > > --with-ttf --with-x --with-ldap --with-snmp --with-xml --with-zlib --with-gdbm --with-db2 > > > > > > and then manually modified the Makefile to add "-lpng -L/usr/X11R6/lib -lXpm > > -lX11" > > to APXS_LDFLAGS, as apache won't start without that. > > > > what other info should i provide? > > > > any tips? > > sorry if this is a duplicate question, but i searched and couldn't really > > seem to find an authoritative resolvement. > > > > thanks for any help. > > > > -tcl. > > > > > > -- > > PHP 3 Mailing List <http://www.php.net/> > > To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net > > To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net > > To search the mailing list archive, go to: > > http://www.php.net/mailsearch.php3 > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net > To search the mailing list archive, go to: > http://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#15550) next »