php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20683 GD 2.0.7 compile failure
Submitted: 2002-11-27 15:05 UTC Modified: 2002-11-27 16:43 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tim at timcrider dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.3.0RC2 OS: Red Hat Linux 8.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tim at timcrider dot com
New email:
PHP Version: OS:

 

 [2002-11-27 15:05 UTC] tim at timcrider dot com
THIS BUG IS FOR 4.3.0 RC2, however this was not an option as a PHP Version

in both
gd_ctx.c and gd.c you can find something like:

#if HAVE_LIBGD204
                io_ctx->gd_free(io_ctx);
#else
                io_ctx->free(io_ctx);
#endif

I am using gd-2.0.7

When I try to compile, it fails with the msg:

/data/BUILD/php/ext/gd/gd_ctx.c: In function `_php_image_output_ctx':
/data/BUILD/php/ext/gd/gd_ctx.c:78: structure has no member named `free'
/data/BUILD/php/ext/gd/gd_ctx.c:110: structure has no member named `free'
/data/BUILD/php/ext/gd/gd.c: In function `_php_image_type':
/data/BUILD/php/ext/gd/gd.c:1156: structure has no member named `free'
/data/BUILD/php/ext/gd/gd.c:1163: structure has no member named `free'
/data/BUILD/php/ext/gd/gd.c: In function `_php_image_create_from':
/data/BUILD/php/ext/gd/gd.c:1345: structure has no member named `free'

However when I comment those out and change it to
XXX->gd_free(xxx);

it compiles like a champ. If you have any questions please feel free to contact me.

Timothy M. Crider
tim@timcrider.com


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-27 15:06 UTC] derick@php.net
Can you please try 4.3.0RC2, this should be fixed:
http://qa.php.net

Derick
 [2002-11-27 15:08 UTC] tim at timcrider dot com
This is for PHP 4.3.0 RC2, however that was not an option on the PHP Version list, so I submitted it under RC1.

 Tim
 [2002-11-27 15:11 UTC] derick@php.net
ok, bug system has been 'fixed' now, also, can you please not use the "add comment" function, but just the "Edit Submission" tab to update your report next time?

Derick
 [2002-11-27 15:51 UTC] iliaa@php.net
I've just tried but was unable to replicate the problem you describe. Could you please show the compile line you are using to compile your PHP? The problem may be the result of more then gd library being used.
 [2002-11-27 16:14 UTC] tim at timcrider dot com
Here is my configure:

./configure --prefix=/usr/local \
--with-apache=../www \
--with-gettext \
--with-gd=/usr \
--with-jpeg-dir=/usr/local \
--with-mcrypt=/usr/local \
--with-mcal=/usr/local \
--with-ming=/usr/local \
--with-mhash=/usr/local \
--with-mysql \
--with-pdflib=/usr/local \
--with-zlib=/usr/local \
--with-ncurses \
--with-tiff-dir="/usr/local" \
--with-unixODBC=/usr/local/unixODBC \
--with-xml \
--with-calendar=shared \
--with-png-dir=/usr/local \
--with-freetype=/usr/local \
--with-freetype-dir=/usr/local \
--with-ttf=/usr/local \
--with-oci8=/usr/local/oracle \
--enable-bcmath \
--enable-calendar \
--enable-dio \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-shmop \
--enable-sigchild \
--enable-sockets \
--enable-track-vars \
--enable-magic-quotes \
--enable-trans-sid \
--enable-libgcc

// Here is the line running with the error
gcc -I/usr/include -Iext/gd/ -I/data/BUILD/php/ext/gd/ -DPHP_ATOM_INC -I/data/BUILD/php/include -I/data/BUILD/php/main -I/data/BUILD/php -I/data/BUILD/php/Zend -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/mcal/include -I/data/BUILD/php/ext/xml/expat  -O3 -march=i686 -mcpu=i686 -fomit-frame-pointer -funroll-loops -fforce-mem -fforce-addr -fexpensive-optimizations -I/data/BUILD/php/TSRM  -O3 -march=i686 -mcpu=i686 -fomit-frame-pointer -funroll-loops -fforce-mem -fforce-addr -fexpensive-optimizations  -c /data/BUILD/php/ext/gd/gd.c -o ext/gd/gd.o  && echo > ext/gd/gd.lo
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning:   as it has already been specified as a non-system directory
cc1: warning: changing search order for system directory "/usr/include"
cc1: warning:   as it has already been specified as a non-system directory
/data/BUILD/php/ext/gd/gd.c: In function `_php_image_type':
/data/BUILD/php/ext/gd/gd.c:1160: structure has no member named `free'
make: *** [ext/gd/gd.lo] Error 1


// //
I'm running GD 2.0.7. But it looks like after configuration the php build thinks I have a lesser version.

If there is any other info you need let me know.

Tim
 [2002-11-27 16:37 UTC] tim at timcrider dot com
Ok, this is odd. I recompiled my gd libraries with the prefix '/usr/local', and changed the entry in my PHP configuration to match it. I uncommented my changes to those to 'gd' files and recompiled. This time the compiled worked fine.

Does anyone have any idea why compiling both gd in /usr and php looking in /usr for gd would cause this to happen, but when you change them both to /usr/local it compiles flawlessly.


NOTE:
I removed /usr/local/lib/libgd.* and /usr/lib/libgd.* and installed gd cleanly both times, however only when it was in /usr/lib does it break. I also ran 'ldconfig' after make install on the gdlibs to sync up the current libraries.

Tim
 [2002-11-27 16:43 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Because by default gd used to be installed in /usr as of 2.0.6 it defaults to /usr/local. Meaning that you may have more then 1 gd library being used, since you tell PHP that both /usr/local and /usr are valid paths to look for libraries & headers. So PHP get's confused and may end up using headers from one place and library from another.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jan 15 08:00:02 2026 UTC