php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28767 mysqli doesn't compile (link fails)
Submitted: 2004-06-14 08:37 UTC Modified: 2004-07-06 07:12 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: Franck at e-Dot dot nl Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.0.0RC3 OS: Linux 2.4.19C13V (Sun Cobalt)
Private report: No CVE-ID: None
 [2004-06-14 08:37 UTC] Franck at e-Dot dot nl
Description:
------------
Hi, I'm trying to build php5 with MySQLi support. But I was not able to do so.

Tried PHP5.0.0RC2, PHP5.0.0RC3 and PHP5-200406140430 with MySQL 4.1.1alpha & 4.1.2alpha.

All give me the same error's.

MySQL install:
I've build my own rpm's from the source rpm.
and installed client, devel, server and shared packages.

PHP Configuration:
./configure \
--prefix=/usr \
--with-apxs=/usr/sbin/apxs \
--with-config-file-path=/etc/httpd \
--with-zlib \
--enable-magic-quotes \
--with-regex=system \
--enable-track-vars \
--with-iconv \
--enable-xml \
--disable-debug \
--with-gd \
--enable-mbstring \
--enable-mbstr-enc-trans \
--with-interbase=shared \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-ldap \
--with-openssl=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--enable-calender \
--with-curl \
--enable-bcmath \
--with-dom \
--with-dom-xslt \
--enable-exit \
--enable-ftp \
--with-gettext \
--enable-mbregex \
--with-mcrypt \
--with-pear \
--enable-sockets \
--with-freetype-dir \
--enable-soap \
--enable-simplexml \
--with-inifile \
--enable-wddx \
--enable-pcntl


This all goes fine, then it all stops on the 'make'.
It seems that compiling is not the problem, only when linking the whole stuff it goes wrong.

Error message:
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): multiple definition of `net_buffer_length'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple definition of `max_allowed_packet'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): multiple definition of `net_read_timeout'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0xc): multiple definition of `net_write_timeout'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0xc): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_server_init':
libmysql.o(.text+0x0): multiple definition of `mysql_server_init'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_debug':
libmysql.o(.text+0x1d0): multiple definition of `mysql_debug'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1d0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_server_end':
libmysql.o(.text+0xf0): multiple definition of `mysql_server_end'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0xf0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_thread_end':
libmysql.o(.text+0x150): multiple definition of `mysql_thread_end'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x150): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_get_parameters':
libmysql.o(.text+0x130): multiple definition of `mysql_get_parameters'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x130): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_thread_init':
libmysql.o(.text+0x140): multiple definition of `mysql_thread_init'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x140): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `pipe_sig_handler':
libmysql.o(.text+0x1e0): multiple definition of `pipe_sig_handler'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x1e0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_master_query':
libmysql.o(.text+0x200): multiple definition of `mysql_master_query'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x200): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_master_send_query':
libmysql.o(.text+0x250): multiple definition of `mysql_master_send_query'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x250): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_slave_query':
libmysql.o(.text+0x2c0): multiple definition of `mysql_slave_query'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x2c0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_slave_send_query':
libmysql.o(.text+0x310): multiple definition of `mysql_slave_send_query'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x310): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_enable_rpl_parse':
libmysql.o(.text+0x3a0): multiple definition of `mysql_enable_rpl_parse'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3a0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o): In function `mysql_disable_rpl_parse':
libmysql.o(.text+0x3c0): multiple definition of `mysql_disable_rpl_parse'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x3c0): first defined here

The above is just the first part of the message. The real message is much bigger! If you need the full message or the full link command, then just say so.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-14 11:31 UTC] Franck at e-Dot dot nl
Ow forgot to say:

Without the --with-mysqli line in the configuration, everything works like a charm!
 [2004-06-21 13:40 UTC] francois at nor-web dot ca
I cannot compile PHP5 RC3 either.
I compiled PHP5Rc1, PHP5Rc2 without problem.

Config:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-gd --with-zlib --enable-sockets --enable-soap --enable-shmop --with-mysqli

MySQL version:
MySQL-server-4.1.1-1
MySQL-shared-4.1.1-0
MySQL-client-4.1.1-0
MySQL-devel-4.1.1-0

Linux version:
Mandrake Linux 10.0 official kernel 2.6.3-7mdksmp

In file included from /opt/php-5.0.0RC3/ext/mysqli/mysqli.c:31:
/opt/php-5.0.0RC3/ext/mysqli/php_mysqli.h:86: error: `LOCAL_INFILE_ERROR_LEN' undeclared here (not in a function)
/opt/php-5.0.0RC3/ext/mysqli/mysqli.c: In function `php_local_infile_init':
/opt/php-5.0.0RC3/ext/mysqli/mysqli.c:744: error: `LOCAL_INFILE_ERROR_LEN' undeclared (first use in this function)
/opt/php-5.0.0RC3/ext/mysqli/mysqli.c:744: error: (Each undeclared identifier is reported only once
/opt/php-5.0.0RC3/ext/mysqli/mysqli.c:744: error: for each function it appears in.)
/opt/php-5.0.0RC3/ext/mysqli/mysqli.c: In function `php_local_infile_read':
/opt/php-5.0.0RC3/ext/mysqli/mysqli.c:825: error: `LOCAL_INFILE_ERROR_LEN' undeclared (first use in this function)
make: *** [ext/mysqli/mysqli.lo] Error 1
 [2004-07-05 02:18 UTC] koshnarek at mdsystem dot homeunix dot com
the same here (PHP5 RC3, MySQL 5.0.0-alpha, Debian GNU/Linux - 2.6.7-1-686):

./configure \
--with-config-file-path=/etc/php \
--with-apxs2=/usr/bin/apxs2 \
--with-mysqli=/usr/lib/mysql/bin/mysql_config \
--with-unixODBC=/usr/include/ \
--with-java=/usr/lib/j2sdk/ \
--with-gettex=/usr/ \
--with-fam=/usr/include/ \
--with-gd=/usr/ \
--with-ttf=/usr/include/ \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-zlib-dir=/usr/ \
--with-xpm-dir=/usr/include/ \
--with-zip=/usr/include/ \
--with-bz2=/usr/include/ \
--with-curl=/usr/include/ \
--with-curlwrappers \
--with-xsl=/usr/include/ \
--with-expat-dir=/usr/include/ \
--with-xmlrpc=/usr/ \
--with-tidy=/usr/ \
--with-openssl=/usr/ \
--with-mcrypt=/usr/ \
--with-snmp=/usr/ \
--with-xslt-sablot \
--enable-ucd-snmp-hack \
--enable-gd-native-ttf \
--enable-bcmath \
--enable-calendar --enable-sysvsem --enable-sysvshm --enable-sysvmsg \
--enable-memory-limit \
--enable-dbx \
--enable-simplexml \
--enable-exif \
--enable-ftp \
--enable-mailparse \
--enable-wddx \
--enable-xslt \
--enable-soap \
--enable-pcntl \
--enable-yp \
--enable-sockets \
--disable-cgi

at this point everything is OK, when I run "make":

/root/php5-5.0.0/ext/iconv/iconv.c: In function `php_iconv_stream_filter_append_bucket':
/root/php5-5.0.0/ext/iconv/iconv.c:2444: warning: passing arg 2 of `iconv' from incompatible pointer type
In file included from /root/php5-5.0.0/ext/mysqli/mysqli.c:31:
/root/php5-5.0.0/ext/mysqli/php_mysqli.h:86: error: `LOCAL_INFILE_ERROR_LEN' undeclared here (not in a function)
/root/php5-5.0.0/ext/mysqli/mysqli.c: In function `php_local_infile_init':
/root/php5-5.0.0/ext/mysqli/mysqli.c:744: error: `LOCAL_INFILE_ERROR_LEN' undeclared (first use in this function)
/root/php5-5.0.0/ext/mysqli/mysqli.c:744: error: (Each undeclared identifier is reported only once
/root/php5-5.0.0/ext/mysqli/mysqli.c:744: error: for each function it appears in.)
/root/php5-5.0.0/ext/mysqli/mysqli.c: In function `php_local_infile_read':
/root/php5-5.0.0/ext/mysqli/mysqli.c:825: error: `LOCAL_INFILE_ERROR_LEN' undeclared (first use in this function)
make: ** [ext/mysqli/mysqli.lo] Erro 1
 [2004-07-05 10:43 UTC] georg@php.net
see #28611, #27642
 [2004-07-05 10:49 UTC] Franck at e-Dot dot nl
Sorry, but the bug id's you gave are about Compiling failures with MySQL 5. I'm not using MySQL 5, but MySQL 4.1.1 & 4.1.2!

Please read/check my bug report again.

With kind regards,

Franck Nijhof
 [2004-07-05 10:59 UTC] derick@php.net
that's the same for us
 [2004-07-06 06:25 UTC] mirage at rateaprof dot com
I know this is really evil but this is something I did, and it got past that 1 problem, but has other link time errors with unresolvable symbols now.  Anywyas, here you go, but I don't exactly recommend this.  I did a grep -r for the usage of the constant and it is only located in the mysqli module in php5rc3, and not in any other module or mysql4.1.1alpha.

other than that, I have no idea what the constant should really be, so just take this as a, hmm, that's interesting kinda point.

--
$Id: php_mysqli.h,v 1.37 2004/06/06 08:52:19 georg Exp $
...

#define LOCAL_INFILE_ERROR_LEN 2048
typedef struct {
        char    error_msg[LOCAL_INFILE_ERROR_LEN];
        void    *userdata;
} mysqli_local_infile;
 [2004-07-06 06:26 UTC] mirage at rateaprof dot com
I know this is really evil but this is something I did, and it got past that 1 problem, but has other link time errors with unresolvable symbols now.  Anywyas, here you go, but I don't exactly recommend this.  I did a grep -r for the usage of the constant and it is only located in the mysqli module in php5rc3, and not in any other module or mysql4.1.1alpha.

other than that, I have no idea what the constant should really be, so just take this as a, hmm, that's interesting kinda point.

--
$Id: php_mysqli.h,v 1.37 2004/06/06 08:52:19 georg Exp $
...

#define LOCAL_INFILE_ERROR_LEN 2048
typedef struct {
        char    error_msg[LOCAL_INFILE_ERROR_LEN];
        void    *userdata;
} mysqli_local_infile;
 [2004-07-06 06:50 UTC] nomail at nospam dot org
How about using an actual 4.1.3-beta? It works fine 
here...
 [2004-07-06 07:12 UTC] Franck at e-Dot dot nl
I'll give 4.1.3-beta a try today. Will let you guys know if it worked out.
 [2004-07-14 22:18 UTC] tumpen at fez dot dk
Just tried php5.0.0 with mysql 4.1.3, and I get the same error, looks like everything works fine in make, but then when its time to link, it fails.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 09 18:00:02 2025 UTC