php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29537 PHP Configure fails with "mysql configure failed" when trying to use 64bit libs
Submitted: 2004-08-05 15:08 UTC Modified: 2004-11-02 10:27 UTC
Votes:23
Avg. Score:4.3 ± 0.9
Reproduced:21 of 21 (100.0%)
Same Version:7 (33.3%)
Same OS:15 (71.4%)
From: martinkuria at hotmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.3.8 OS: Solaris9
Private report: No CVE-ID: None
 [2004-08-05 15:08 UTC] martinkuria at hotmail dot com
Description:
------------
I'm trying to configure PHP to use the client libraries for MySQL 4.0.16,
which I downloaded as a binary (Solaris 9 64-bit) and installed in
/usr/local/mysql.

When I attempt to configure PHP using:

./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.29
--with-openssl=/usr/local/ssl --with-zlib-dir=./ext/zlib
--enable-track-vars --enable-libgcc --disable-cgi

I get the following error:

checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more
information.

Config.log shows:

configure:55581: checking for mysql_error in -lmysqlclient
configure:55600: gcc -o conftest -g -O2  -D_POSIX_PTHREAD_SEMANTICS
-R/usr/local/mysql/lib -L/usr/local/mysql/lib  -R/usr/ucblib -L/usr/ucblib
-R/opt/sfw/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.9/3.2
-L/opt/sfw/gcc-3.2/lib/gcc-lib/sparc-sun-solaris2.9/3.2
-R/usr/local/ssl/lib -L/usr/local/ssl/lib -R/usr -L/usr conftest.c
-lmysqlclient  -lz -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl -lsocket 
-lgcc 1>&5
ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o): wrong
ELF class: ELFCLASS64
Undefined                       first referenced
 symbol                             in file
mysql_error                         /var/tmp//cc4fDlj3.o
ld: fatal: Symbol referencing errors. No output written to conftest


These are not the final lines, but they seem most relevant; I can post
more if necessary.

Is it possible that PHP is looking for a 32-bit MySQL binary and crashing
when it finds a 64-bit? If so, are there plans to support 64-bit MySQL?


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-19 11:53 UTC] wkaiser at mpimf-heidelberg dot mpg dot de
I experienced the same trying to upgrade my PHP / MySQL combination. I am using Solaris 9 (on a SunFire V240), Apache 1.3.29, MySQL 4.0.l8 and PHP 4.3.4. The MySQL Upgrade to 4.1.4-gamma worked fine (i just unpacked the binaries, moved them to /usr/local besides the old ones and changed the symbolic link). Then i unpacked the php-5.0.1 src file, adapted my PATH vars and started configure:

bash-2.05# gunzip < php-5.0.1.tar.gz | /usr/local/bin/tar xovf -
bash-2.05# cd php-5.0.1
bash-2.05# export CC=/usr/local/bin/gcc
bash-2.05# export LDFLAGS="-L/usr/lib -L/usr/local -L/usr/local/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/lib/sasl2"
bash-2.05# export CPPFLAGS="-I/usr/include -I/usr/local/include -I/usr/local/mysql/include -I/usr/local/apache/include"
bash-2.05# export PATH=/usr/sbin:/usr/bin:/usr/lib/nis:/usr/local/bin:/usr/ccs/bin:/usr/local/apache/bin/apxs:/usr/local/mysql/bin:/usr/local/mysql/bin/mysql_config

bash-2.05# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ssl=/usr/local/ssl --with-cyrus-sasl --with-zlib-dir=/usr/local/include --with-gd --with-jpeg-dir=/usr/local/lib --enable-gd-native-ttf --enable-gd-jis-conv --with-curl=/usr/local/include/curl --with-curlwrappers

I received exactly the same error message:

checking for MySQL support... no
checking for specified location of the MySQL UNIX socket... no
checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check config.log for more information.

The config.log says:
--------------------

bash-2.05# cat config.log

configure:53849: checking for MySQL support
configure:53895: checking for specified location of the MySQL UNIX socket
configure:54924: checking for MySQLi support
configure:54970: checking whether to enable embedded MySQLi support
configure:55103: checking for mysql_set_server_option in -lmysqlclient
configure:55122: /usr/local/bin/gcc -o conftest -g -O2 -I/usr/include -I/usr/local/include -I/usr/local/mysql/include -I/usr/local/apache/include -D_POSIX_PTHREAD_SEMANTICS -R/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/lib -L/usr/local -L/usr/local/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/lib/sasl2 -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2 -R/usr/local/lib -L/usr/local/lib -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/local/ssl/lib -L/usr/local/ssl/lib -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm conftest.c -lmysqlclient  -lpng -lz -ljpeg -lcurl -lz -lresolv -lm -ldl -lnsl -lsocket  -lgcc -lxml2 -lz -liconv -lm -lsocket -lnsl -lcurl -lz -lssl -lcrypto -ldl -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 1>&5
ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF class: ELFCLASS64
Undefined                       first referenced
symbol                             in file
mysql_set_server_option             /var/tmp//cc2SpwA0.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 55111 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_set_server_option();

int main() {
mysql_set_server_option()
; return 0; }
 [2004-10-18 03:54 UTC] rsm00th at hotmail dot com
I am having the same problem. It appears as though it wont compile because we are running 64-bit MySQL.
 [2004-10-19 13:11 UTC] royw at imsi dot com
I am also seeing this and concur with the 64bit version of mysql the reason.

from config.log
==================
configure:54351: gcc -o conftest -g -O2 -pthreads  -D_POSIX_PTHREAD_SEMANTICS -D
_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -R/usr/local/mysql/lib -L/usr/local/mysql/
lib -R/usr/local/lib -L/usr/local/lib  -R/usr/ucblib -L/usr/ucblib -R/local/u1/l
ocal/bin/../lib/gcc/sparc-sun-solaris2.8/3.4.0 -L/local/u1/local/bin/../lib/gcc/
sparc-sun-solaris2.8/3.4.0 -R/usr/local/lib -L/usr/local/lib -R/usr/local -L/usr
/local conftest.c -lmysqlclient  -lz -lldap -llber -lz -lresolv -lm -ldl -lnsl -
lsocket  -lgcc -lxml2 -liconv -lm -lsocket -lnsl -lxml2 -liconv -lm -lsocket -ln
sl 1>&5
ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF c
lass: ELFCLASS64
Undefined                       first referenced
 symbol                             in file
mysql_error                         /var/tmp//ccOaQw7R.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 54340 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }
==============================

Thanks

-Roy
 [2004-10-19 13:13 UTC] royw at imsi dot com
Sorry for being a dumbass, in the above i'm using

Solaris 8, and php 5.0.1

Thanks

-Roy
 [2004-11-02 00:07 UTC] epuening at cdir dot com
Same error using Solaris 8, Apache 2.052, PHP 5.02, mysql 5.01

Configured with the following options
./configure --with-apxs2=/usr/local/apache2/bin/apxs 
--with-mysql=/usr/local/mysql/ 
--enable-dbase --with-libxml-dir=/usr/local/include/libxml2

Terminates with the following error

char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:54501: checking for mysql_errno in -lmysqlclient
configure:54520: gcc -o conftest -g -O2  -D_POSIX_PTHREAD_SEMANTICS -R/usr/local/mysql//lib -L/usr/local/mysql//lib  -R/usr
/ucblib -L/usr/ucblib -R/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -L/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1 -R/us
r/local/lib -L/usr/local/lib conftest.c -lmysqlclient  -lz -lresolv -lm -ldl -lnsl -lsocket  -lgcc -lxml2 -lz -liconv -lm -
lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 1>&5
ld: warning: file /usr/local/mysql//lib/libmysqlclient.a(client.o): wrong ELF class: ELFCLASS64
Undefined                       first referenced
 symbol                             in file
mysql_errno                         /var/tmp//ccQGgMLT.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 54509 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_errno();

int main() {
mysql_errno()
; return 0; }
 [2004-11-02 10:27 UTC] jorton@php.net
If you want to use 64-bit MySQL libraries you'll need to build a 64-bit PHP, i.e.:

export CC="/path/to/gcc -m64"

if you want to build a 32-bit PHP, you'll have to use 32-bit MySQL libraries. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 00:01:27 2024 UTC