PHP 4.0 Bug #9512 Updated: Apache fails linking due to incorrect PHP lib ordering
| From: | sitz at onastick dot net | Date: | Sat, 17 Mar 2001 05:16:32 +0000 |
| Subject: | PHP 4.0 Bug #9512 Updated: Apache fails linking due to incorrect PHP lib ordering | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49194@lists.php.net to get a copy of this message | ||
ID: 9512
User Update by: sitz@onastick.net
Old-Status: Feedback
Status: Open
Bug Type: GD related
Description: Apache fails linking due to incorrect PHP lib ordering
Yep. Same error, same place. Same fix required to link (except I typoed my damn fix in the previous
message and justnow noticed. This is what I get for filing bug reports when I'm half asleep. :\
)
This:
-lmodphp4 -lpam -ldl -lz -lmysqlclient -lpng -lz -lgd -ljpeg
needs to be chang to this:
-lmodphp4 -lpam -ldl -lz -lmysqlclient -lgd -lpng -lz -ljpeg
...or something similar.
Previous Comments:
---------------------------------------------------------------------------
[2001-03-16 20:50:34] sniper@php.net
Does this happen with latest CVS snapshot from http://snaps.php.net/ ??
--Jani
---------------------------------------------------------------------------
[2001-03-01 14:49:29] sitz@onastick.net
PHP is configured thusly:
./configure
--enable-versioning
--with-apache=../apache_1.3.19
--with-config-file-path=/etc
--with-ftp
--with-gd=/shared
--with-tiff-dir=/shared/lib
--with-jpeg-dir
--with-mysql=/local
--with-xml
--with-zlib=/shared
--with-pdflib=/shared/lib
--enable-safe-mode
--enable-track-vars
--enable-force-cgi-redirect
--enable-memory-limit
--enable-sysvsem
--enable-sysvshm
--with-gdbm=/shared
--with-db2=/shared
--with-cdb=/shared
PHP compiles and installs successfully.
Apache is configured thusly:
./configure
--prefix=/shared/apache
--exec-prefix=/shared/apache
--bindir=/shared/apache/bin
--sbindir=/shared/apache/sbin
--mandir=/shared/apache/man
--sysconfdir=/shared/apache/conf
--logfiledir=/shared/apache/logs
--runtimedir=/shared/apache/logs
--libexecdir=/shared/apache/libexec
--localstatedir=/shared/apache/logs
--activate-module=src/modules/perl/libperl.a
--activate-module=src/modules/php4/libphp4.a
--enable-module=access
--disable-module=actions
--enable-module=alias
--enable-module=asis
--enable-module=auth
--enable-module=auth_anon
--enable-module=auth_db
--enable-module=auth_dbm
--enable-module=autoindex
--enable-module=cern_meta
--enable-module=cgi
--enable-module=dir
--enable-module=env
--enable-module=expires
--enable-module=headers
--disable-module=imap
--enable-module=include
--disable-module=info
--enable-module=log_config
--enable-module=mime
--disable-module=mime_magic
--disable-module=mmap_static
--enable-module=negotiation
--enable-module=rewrite
--enable-module=setenvif
--disable-module=so
--enable-module=speling
--enable-module=status
--disable-module=userdir
--enable-module=unique_id
--enable-module=usertrack
--enable-suexec
--suexec-caller=apache
--suexec-docroot=/htdocs
--suexec-logfile=/logs/suexec_log
--suexec-safepath=/bin:/usr/bin:/usr/local/bin
--suexec-uidmin=1000
--suexec-gidmin=1000
When compiing apache, the following error appears:
Undefined first referenced
symbol in file
png_set_strip_16 /shared/lib/libgd.a(gd_png.o)
png_set_read_fn /shared/lib/libgd.a(gd_png.o)
png_create_write_struct /shared/lib/libgd.a(gd_png.o)
png_create_read_struct /shared/lib/libgd.a(gd_png.o)
png_set_tRNS /shared/lib/libgd.a(gd_png.o)
png_write_end /shared/lib/libgd.a(gd_png.o)
png_get_PLTE /shared/lib/libgd.a(gd_png.o)
png_read_end /shared/lib/libgd.a(gd_png.o)
png_set_packing /shared/lib/libgd.a(gd_png.o)
png_read_info /shared/lib/libgd.a(gd_png.o)
png_write_image /shared/lib/libgd.a(gd_png.o)
png_destroy_write_struct /shared/lib/libgd.a(gd_png.o)
png_check_sig /shared/lib/libgd.a(gd_png.o)
png_set_dither /shared/lib/libgd.a(gd_png.o)
png_get_IHDR /shared/lib/libgd.a(gd_png.o)
png_get_rowbytes /shared/lib/libgd.a(gd_png.o)
png_set_strip_alpha /shared/lib/libgd.a(gd_png.o)
png_read_update_info /shared/lib/libgd.a(gd_png.o)
png_create_info_struct /shared/lib/libgd.a(gd_png.o)
png_set_IHDR /shared/lib/libgd.a(gd_png.o)
png_write_info /shared/lib/libgd.a(gd_png.o)
png_set_write_fn /shared/lib/libgd.a(gd_png.o)
png_get_io_ptr /shared/lib/libgd.a(gd_png.o)
png_read_image /shared/lib/libgd.a(gd_png.o)
png_destroy_read_struct /shared/lib/libgd.a(gd_png.o)
png_get_error_ptr /shared/lib/libgd.a(gd_png.o)
png_set_sig_bytes /shared/lib/libgd.a(gd_png.o)
png_get_valid /shared/lib/libgd.a(gd_png.o)
png_get_tRNS /shared/lib/libgd.a(gd_png.o)
png_set_PLTE /shared/lib/libgd.a(gd_png.o)
ld: fatal: Symbol referencing errors. No output written to httpd
The problem lies in the order of the libs passed to the linker. This is a partial snippet of what is
passed:
-lmodphp4 -lpam -ldl -lz -lmysqlclient -lpng -lz -lgd -ljpeg
The solaris linker (/usr/ccs/bin/ld) needs -lpng to be to the right of -lgd in order to complete the
linking. If I change the above to:
-lmodphp4 -lpam -ldl -lz -lmysqlclient -lgz -lpng -lz -ljpeg
Linking succeeds with no issues.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=9512