From:             [EMAIL PROTECTED]
Operating system: RedHat 7.2
PHP version:      4.0CVS-2002-02-07
PHP Bug Type:     Compile Failure
Bug description:  mnogosearch & mysql - gamble party

> System
RedHat linux for i386

> MySQL
$ rpm -qa |grep MySQL
MySQL-devel-3.23.47-1
MySQL-client-3.23.47-1
MySQL-3.23.47-1

There is no shared lib of mysql. Just only .a (_static_ lib) and 
.h files.

> Apache
Apache was not instaled witch distro, this is first and only one 
instalation in system.

; we are 100% sure that no old stuff left
$ rm -rf  /usr/local/apache/ apache_1.3.22/
$ tar zxfv apache_1.3.22.tar.gz ; cd apache_1.3.22
; standard instalation
$./configure --with-layout=Apache --enable-module=rewrite \
--enable-module=expires --enable-module=headers \
--enable-shared=rewrite --enable-shared=expires \
--enable-shared=headers
$ make && make install
; done
$ cd ..

> Mnogosearch
Mnogosearch was not instaled witch distro, this is first and 
only one instalation in system.

; we are 100% sure that no old stuff left
$ rm -rf mnogosearch-3.1.19/ /usr/local/mnogosearch-3.1.19
$ tar zxfv mnogosearch-3.1.19.tar.gz ; cd mnogosearch-3.1.19/
; standard instalation
$ ./configure --with-mysql=/usr \
--prefix=/usr/local/mnogosearch-3.1.19
$ make && make install
; done
$ cd ..
; lets check whats installed
$ ls /usr/local/mnogosearch-3.1.19/lib/
libudmsearch.a  libudmsearch.la

After install stage only _static_ lib was found in lib dir of 
mnogosearch. There was no shared .so lib.

> Php
Php was not instaled witch distro.

; we are 100% sure that no old stuff left
$ rm -rf php4-200202071200/
$ tar zxfv php4-200202071200.tar.gz ; cd php4-200202071200/
; standard instalation
$ ./configure  --with-apxs=/usr/local/apache/bin/apxs \
--with-mysql=/usr --with-zlib --enable-memory-limit \
--with-mnogosearch=/usr/local/mnogosearch-3.1.19
$ make
- error ----------------------------------------------
/bin/sh /root/php4-200202071200/libtool --silent --mode=link gcc  
-I. -I/root/php4-200202071200/ -I/root/php4-200202071200/main 
-I/root/php4-200202071200 -I/usr/local/apache/include 
-I/root/php4-200202071200/Zend 
-I/usr/local/mnogosearch-3.1.19/include -I/usr/include/mysql 
-I/root/php4-200202071200/ext/xml/expat  -DLINUX=22 -DUSE_HSREGEX 
-I/root/php4-200202071200/TSRM -g -O2 -prefer-pic   -o libphp4.la 
-rpath /root/php4-200202071200/libs -avoid-version 
-L/usr/lib/mysql -L/usr/local/mnogosearch-3.1.19/lib  -R 
/usr/lib/mysql -R /usr/local/mnogosearch-3.1.19/lib stub.lo  
Zend/libZend.la sapi/apache/libsapi.la main/libmain.la 
regex/libregex.la /root/php4-200202071200/ext/zlib/libzlib.la 
/root/php4-200202071200/ext/mnogosearch/libmnogosearch.la 
/root/php4-200202071200/ext/mysql/libmysql.la 
/root/php4-200202071200/ext/overload/liboverload.la 
/root/php4-200202071200/ext/pcre/libpcre.la 
/root/php4-200202071200/ext/posix/libposix.la 
/root/php4-200202071200/ext/session/libsession.la 
/root/php4-200202071200/ext/standard/libstandard.la 
/root/php4-200202071200/ext/xml/libxml.la TSRM/libtsrm.la -lpam 
-lmysqlclient -lz -ludmsearch -lz -lm -lmysqlclient -lz -lcrypt 
-lresolv -lm -ldl -lnsl -lresolv -lcrypt -ldl
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple 
definition of `mysql_port'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): first 
defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): multiple 
definition of `mysql_unix_port'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): first 
defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function 
`net_safe_read':
libmysql.o(.text+0x1cc): multiple definition of `net_safe_read'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1cc): first 
defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function 
`simple_command':
libmysql.o(.text+0x2d4): multiple definition of `simple_command'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x2d4): first 
defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function 
`mysql_real_connect':
libmysql.o(.text+0xc6c): multiple definition of 
`mysql_real_connect'
[... and lots more of this ....]
------------------------------------------------------
$ cd ..

Why? And don't know. Maybe someday/someone fix this...
But, lets try other way:

$ rm -rf php4-200202071200/
$ tar zxfv php4-200202071200.tar.gz ; cd php4-200202071200/
; lets add shared to "--with-mysql"
$ ./configure  --with-apxs=/usr/local/apache/bin/apxs \
--with-mysql=shared,/usr --with-zlib --enable-memory-limit \
--with-mnogosearch=/usr/local/mnogosearch-3.1.19
$ make
; compilation done :)
; check what is/isn't shared
$ ldd .libs/libphp4.so
        libdl.so.2 => /lib/libdl.so.2 (0x40182000)
        libpam.so.0 => /lib/libpam.so.0 (0x40186000)
        libz.so.1 => /usr/lib/libz.so.1 (0x4018e000)
        libm.so.6 => /lib/i686/libm.so.6 (0x4019c000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x401bf000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x401ec000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x401fe000)
        libc.so.6 => /lib/i686/libc.so.6 (0x40215000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
$ cd ..

Compilation done, thats ok :) but why?

Why php could not detect their dependences at configure stage?

When I add "shared" ony to "--with-mnogosearch" - php compiles 
fine.
When I add "shared" to both "--with-mnogosearch" and 
"--with-mysql" - php compiles fine.
When I skip "shared" in both "--with-mnogosearch" and 
"--with-mysql" - php compilation fails.

What this "shared" option really means? There was no .so lib of 
mysql and mnogosearch.
Is there (in php) more hacks like this one?


-- 
Edit bug report at http://bugs.php.net/?id=15436&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15436&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15436&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15436&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15436&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15436&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15436&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15436&r=notenoughinfo


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to