php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15346 mysql mnogosearch - php & static libs
Submitted: 2002-02-03 00:30 UTC Modified: 2002-06-17 10:40 UTC
From: seba at iq dot pl Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.1.1 OS: Linux 2.2
Private report: No CVE-ID: None
 [2002-02-03 00:30 UTC] seba at iq dot pl
http://bugs.php.net/bug.php?id=14824

: This could happen for example if you compiled mnogosearcg
: statically with mysql and trying to compile it with php, which
: is also required mysql. So you are linking mysql twice. 
:
: To fix this - just compile mnogosearch and php with dynamic
: libs not static.

Lets play:

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

No one finds static lib - no one use it:
$ cd /usr/lib/mysql/
$ mv libmysqlclient.a libmysqlclient.a_

Mnogosearch...
; no old stuff left here
$ 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/
; dynamic, be dynamic...
$ ./configure --with-mysql --prefix=/usr/local/mnogosearch-3.1.19 
--enable-shared --disable-static
$ make && make install
; compilation successfull
$ ldd /usr/local/mnogosearch-3.1.19/lib/libudmsearch-3.1.so
        libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10 
(0x0014b000)
[...]
; did we win?

Php...
; no old stuff left here
$ rm -rf php4-200201261200/
$ tar zxfv php4-200201261200.tar.gz
$ cd php4-200201261200/
; minimum config for compile test
$ ./configure --with-mysql=shared,/usr --with-zlib 
--with-mnogosearch=/usr/local/mnogosearch-3.1.19
$ make
; ... ...
/bin/sh /root/php4-200201261200/libtool --silent --mode=link gcc 
-I. -I/root/php4-200201261200/sapi/cli 
-I/root/php4-200201261200/main -I/root/php4-200201261200 
-I/root/php4-200201261200/Zend 
-I/usr/local/mnogosearch-3.1.19/include -I/usr/include/mysql 
-I/root/php4-200201261200/ext/xml/expat  
-I/root/php4-200201261200/TSRM -g -O2   -o php -export-dynamic  
libphp4cli.la
gcc: /usr/lib/mysql/libmysqlclient.a: No such file or directory
make[2]: *** [php] Error 1
make[2]: Leaving directory `/root/php4-200201261200/sapi/cli'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/php4-200201261200/sapi/cli'
make: *** [all-recursive] Error 1

> gcc: /usr/lib/mysql/libmysqlclient.a: No such file or directory

Where php found this static lib and decide to use it?


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-03 11:55 UTC] gluke@php.net
This is a bug in PHP as i think, i dont know why it
searches for static mysql library.

I suggest you to configure mnogosearch with --enable-static,
and configure PHP as usual , e.g --with-mysql=/usr

Such configuration works fine for me.

 [2002-02-03 11:55 UTC] gluke@php.net
This is a bug in PHP as i think, i dont know why it
searches for static mysql library.

I suggest you to configure mnogosearch with --enable-static,
and configure PHP as usual , e.g --with-mysql=/usr

Such configuration works fine for me.

 [2002-06-15 21:29 UTC] sniper@php.net
Please try this snapshot:

http://snaps.php.net/php4-latest.tar.gz

 [2002-06-17 10:40 UTC] seba at iq dot pl
still: "gcc: /usr/lib/mysql/libmysqlclient.a: No    
such file or directory"    
    
but, I found soultion.    
    
This behaviour is probably caused by MySQL package. 
    
When I change it from:  
MySQL-client-3.23.47-1 
MySQL-devel-3.23.47-1 
MySQL-3.23.47-1 
MySQL-shared-3.23.47-1 
(from www.mysql.com website) 
to: 
mysql-3.23.49-3 
mysql-devel-3.23.49-3 
(from rh7.3) 
 
all problems gone. 
 
Now I'm using php-4.2.1, this looks great: 
$ ldd libphp4.so |egrep "mysql|udmsearch" 
        libmysqlclient.so.10 => 
/usr/lib/mysql/libmysqlclient.so.10 (0x00385000) 
        libudmsearch-3.1.so => 
/usr/local/mnogosearch-3.1.19/lib/libudmsearch-3.1.so 
(0x003bc000) 
and: 
$ ldd libudmsearch.so |grep mysql 
        libmysqlclient.so.10 => 
/usr/lib/mysql/libmysqlclient.so.10 (0x0014a000) 
 
Everything above is made without removing any 
static lib of mysql. 
 
I don't know why mysql package provided by mysql 
dev team make this mess.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 07 20:01:28 2024 UTC