php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1203 PHP fails to compile into Apache as a DSO when mod_perl is compiled in
Submitted: 1999-03-04 17:37 UTC Modified: 1999-06-20 14:10 UTC
From: sitz at onastick dot net Assigned:
Status: Closed Package: Compile Failure
PHP Version: 3.0.7 OS: Linux 2.0.36 (glibc)
Private report: No CVE-ID: None
 [1999-03-04 17:37 UTC] sitz at onastick dot net
When compiling PHP 3.0.7  as a shared module into Apache 1.3.4 (and at the same time compiling mod_perl 1.18 into apache as a static module) the following errors occur:

===> src/modules/php3
gcc -c -I../..  -I/usr/lib/perl5/i386-linux/5.004/CORE  -I../../os/unix -I../../include   -DLINUX=2 -DMOD_PERL -DUSE_PERL_SSI -Dbool=char -DHAS_BOOL -D_REENTRANT -DUSE_HSREGEX `../../apaci` -fpic -DSHARED_MODULE  mod_php3.c && mv mod_php3.o mod_php3.so-o
rm -f libphp3.so
ld -Bshareable -o libphp3.so mod_php3.so-o libmodphp3-so.a  -Wl,-rpath,/usr/lib -L/usr/lib -lmysqlclient                             -lm -ldl -lcrypt -lnsl  -lresolv  -lm -lcrypt -ldbm -lgdbm -rdynamic  -L/usr/local/lib /usr/lib/perl5/i386-linux/5.004/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/i386-linux/5.004/CORE -lperl -lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt  -ldl
ld: unrecognized option `-Wl,-rpath,/usr/lib'
make[4]: *** [libphp3.so] Error 1

Changing -Wl,-rpath,/usr/lib to -rpath /usr/lib in the LIBS1 line of src/modules/php3/Makefile solves this problem, however the next error is:

===> src/modules/php3
rm -f libphp3.so
ld -Bshareable -o libphp3.so mod_php3.so-o libmodphp3-so.a  -rpath /usr/lib -L/usr/lib -lmysqlclient                             -lm -ldl -lcrypt -lnsl  -lresolv  -lm -lcrypt -ldbm -lgdbm -rdynamic  -L/usr/local/lib /usr/lib/perl5/i386-linux/5.004/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/i386-linux/5.004/CORE -lperl -lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt  -ldl
ld: -r and -shared may not be used together
make[4]: *** [libphp3.so] Error 1

Removing "-rdynamic" from the LIBS1 line of the same Makefile gets us past this hurdle, and the compile finishes normally.

The first error can be eliminated if PHP is compiled without mysql support since the offending "-Wl,-rpath" isn't placed in the Makefile at all at that point.

The second error is eliminated if mod_perl isn't compiled in at all.

That being said, it should be notes that I don't currently program/script in anything other than perl, so if I'm missing something obvious, please let me know :)

gcc --version
2.7.2.3

make --version
GNU Make version 3.76.1

./configure --with-mysql --enable-track-vars --with-shared-apache=/usr/local/src/apache_1.3.4

Noah Robin

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-20 14:10 UTC] sas at cvs dot php dot net
These kind of errors should be fixed since 3.0.8.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 03:01:32 2024 UTC