GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD creates PNG, JPEG and GIF images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve web site development.
See the GD website for more informations.
FS#125 — JPEG and PNG support missing in php (gd v2.0.33)
Opened by Bob Atkins (bobatkins) - Monday, 15 October 2007, 01:18 GMT+2
Last edited by Pierre Joye (Pierre) - Saturday, 17 November 2007, 22:34 GMT+2
|
DetailsPHP keeps reporting no JPEG and PNG support yet gd configure confirms jpeg and png support and gdlib-config –features also shows that both have been included. ldd check against libgd.so also shows that the jpeg and png libs are linked in. Any help insolving this mystery would be greatly appreciated. ** Configuration summary for gd 2.0.33: Support for PNG library: yes Support for JPEG library: yes Support for Freetype 2.x library: yes Support for Fontconfig library: no Support for Xpm library: yes Support for pthreads: yes php -info gd GD Support ⇒ enabled GD Version ⇒ 2.0 or higher FreeType Support ⇒ enabled FreeType Linkage ⇒ with freetype FreeType Version ⇒ 2.2.1 T1Lib Support ⇒ enabled GIF Read Support ⇒ enabled GIF Create Support ⇒ enabled WBMP Support ⇒ enabled I have confirmed that php is not using the bundled gd. % gdlib-config –features GD_XPM GD_JPEG GD_FREETYPE GD_PNG GD_GIF % ldd /opt/lib/libgd.so libXpm.so.4 => /opt/lib/libXpm.so.4 libX11.so.4 => /usr/lib/libX11.so.4 libjpeg.so.62 => /opt/lib/libjpeg.so.62 libfreetype.so.6 => /opt/lib/libfreetype.so.6 libpng12.so.0 => /opt/lib/libpng12.so.0 libz.so => /opt/lib/libz.so libm.so.1 => /usr/lib/libm.so.1 libc.so.1 => /usr/lib/libc.so.1 libgcc_s.so.1 => /opt/lib/libgcc_s.so.1 libXext.so.0 => /usr/openwin/lib/libXext.so.0 libsocket.so.1 => /usr/lib/libsocket.so.1 libnsl.so.1 => /usr/lib/libnsl.so.1 libdl.so.1 => /usr/lib/libdl.so.1 libmp.so.2 => /usr/lib/libmp.so.2 /usr/platform/SUNW,UltraSPARC-IIi-Engine/lib/libc_psr.so.1 |
Saturday, 17 November 2007, 22:34 GMT+2
Reason for closing: Not a bug
Additional comments about closing: Looks like no further info will be provided. Feel free to reopen this bug or add a comment if you have more details.
Yes, I have read the FAQ regarding this issue and done what it says... No joy.
How did you compile PHP? Please copy the configure line here.
PHP 5.2.0 has been built with the following configuration:
./configure' '–prefix=/opt' '–with-mod_charset' '–with-pear' '–with-config-file-path=/opt/etc' '–with-apxs2=/opt/apache2/bin/apxs' '–with-mysql=/opt' '–with-mcrypt=/opt' '–with-openssl=/opt' '–with-openssl-dir=/opt' '–with-libxml-dir=/opt' '–with-imap=/opt/imap' '–with-imap-ssl=/opt/ssl' '–with-zlib=/opt' '–with-zlib-dir=/opt' '–with-bz2=/opt' '–with-gd=/opt' '–enable-gd-native-ttf' '–with-jpeg-dir=/opt' '–with-png-dir=/opt' '–with-xpm-dir=/opt' '–with-ttf' '–with-freetype-dir=/opt' '–with-t1lib=/opt' '–with-ncurses=/opt' '–with-curl=/opt' '–with-gettext=/opt' '–with-xsl=/opt' '–enable-bcmath' '–enable-calendar' '–enable-wddx' '–enable-shmop' '–enable-sysvmsg' '–enable-sysvsem' '–enable-sysvshm' '–enable-cli' '–enable-mbstring' '–enable-soap' '–enable-track-vars' '–enable-memory-limit' '–enable-static=no' '–enable-fastcgi' '–enable-dba' '–enable-exif' '–enable-ftp' '–disable-debug' '–disable-rpath'
Please compile php using:
...’–with-gd’ ...
and try again.
Btw, you may seriously consider to upgrade to a recent PHP version (5.2.4 for example). 5.2.0 contains many security issues.
php is already compiled '-with-gd=/opt'. Please check my posted php configuration above to confirm.
gd is working with php and gdtest.php reports:
Thank you for the advise regarding upgrading php to a later version. Unfortunately, there is always a reason to upgrade but we cannot be constantly chasing the latest version. There were also some very bad releases after 5.2.0 and some very good reasons not to upgrade.
I still strongly recommend to upgrade to 5.2.4 but that does not change the fact: you should compile using: '–with-gd'. Please try with this option.
'-with-gd' and 'with-gd=/opt' are equivalent to enable the gd option. I must use '-with-gd=/opt' or the gd libraries which are in /opt/lib will not be found.
I think I have very clearly shown that gd has been built into php and specifically the JPG and PNG image support is not working. Wasting my time recompiling with just '-with-gd' will not prove anything as the build will fail by not finding the gd libs in /opt/lib and building php 5.2.4 isn't likely going to fix anything either.
When I figure out the solution I'll be sure to keep it to myself.
They are not equivalent. One will use the external library (and disable almost all new features in php-gd since 4.3.0) and the other ("–with-gd") will enable the bundled library.
I'm sorry but you missed my point. As I can understand why you don't want to upgrade PHP, you should consider two things:
As the maintainer of the PHP GD extension and its bundled library and the libgd library (libgd.org), I strongly suggest you to use the "–with-gd" option.
Sure but you are missing my goal: trying to help you to get php working.
Now about your problem, I don't have a sun to test a build. Have you installed the libpng and libjpeg development package and/or are the headers available in the default location when you compiled php?