php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29520 php mysql compile fail
Submitted: 2004-08-04 12:37 UTC Modified: 2010-07-27 05:13 UTC
Votes:29
Avg. Score:4.3 ± 0.9
Reproduced:26 of 27 (96.3%)
Same Version:11 (42.3%)
Same OS:7 (26.9%)
From: martinkuria at hotmail dot com Assigned: srinatar (profile)
Status: Not a bug Package: Compile Failure
PHP Version: 5.0.0 OS: Solaris9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: martinkuria at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-08-04 12:37 UTC] martinkuria at hotmail dot com
Description:
------------
I am installing php but am getting the error below, could it be this php-release mysql-client is not included please advice

Reproduce code:
---------------
configure:39850: checking if your cpp allows macro usage in include lines
configure:39862: gcc -c -I/usr/include -g -O2  -D_POSIX_PTHREAD_SEMANTICS conftest.c 1>&5
configure:40127: checking for IMAP support
configure:41422: checking for Informix support
configure:42018: checking for Ingres II support
configure:42534: checking for InterBase support
configure:43344: checking for IRCG support
configure:43972: checking for LDAP support
configure:44018: checking for LDAP Cyrus SASL support
configure:46735: checking whether to enable multibyte string support
configure:46781: checking whether to enable multibyte regex support
configure:46806: checking for external libmbfl
configure:48142: checking for mcrypt support
configure:48879: checking for MCVE support
configure:48925: checking OpenSSL dir for MCVE
configure:50291: checking for mhash support
configure:50701: checking whether to include mime_magic support
configure:50994: checking for MING support
configure:51669: checking for mnoGoSearch support
configure:52083: checking for msession support
configure:52678: checking for mSQL support
configure:53125: checking for MSSQL support via FreeTDS
configure:53707: checking for MySQL support
configure:53753: checking for specified location of the MySQL UNIX socket
configure:53810: checking for MySQL UNIX socket location
configure:53966: checking for mysql_close in -lmysqlclient
configure:53985: 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/local/bin/../lib/gcc-lib/sparc-sun-solaris2.9/3.3 -L/local/bin/../lib/gcc-lib/sparc-sun-solaris2.9/3.3 -R/usr/local/lib -L/usr/local/lib -R/usr/local/ssl/lib -L/usr/local/ssl/lib -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/local/gd// -L/usr/local/gd// conftest.c -lmysqlclient  -lgd -lt1 -lfreetype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lssl -lcrypto -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_close                         /var/tmp//ccYGWfaf.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 53974 "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_close();

int main() {
mysql_close()
; return 0; }
configure:54190: checking for mysql_error in -lmysqlclient
configure:54209: 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/local/bin/../lib/gcc-lib/sparc-sun-solaris2.9/3.3 -L/local/bin/../lib/gcc-lib/sparc-sun-solaris2.9/3.3 -R/usr/local/lib -L/usr/local/lib -R/usr/local/ssl/lib -L/usr/local/ssl/lib -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/local/gd// -L/usr/local/gd// -R/usr -L/usr conftest.c -lmysqlclient  -lz -lgd -lt1 -lfreetype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lssl -lcrypto -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_error                         /var/tmp//ccmHP4RE.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 54198 "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; }



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-04 12:46 UTC] martinkuria at hotmail dot com
Below is the error am getting, it says also that mysql client library is not bundled anymore in the php-5.0.0 version, what does that mean? and how can I resolve that to complite my php-5.0.0 please advice

checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore.
 [2004-08-17 17:25 UTC] tony2001@php.net
You need library headers in order to compile PHP with MySQL support. As I can see, you've already solved the problem with 64-bit libraries. Porbably, you just installed 32-bit version of mysql libs. Am I right?
 [2004-08-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2004-09-25 14:51 UTC] yongbinchen at sohu-inc dot com
i can't find mysql.h through find / -name mysql.h .
i installed mysql through rpm method.
 [2004-09-26 20:55 UTC] nhrajab at hotmail dot com
I had this problem with mysql 4.0.21 and php5.0.1. I installed mysql from rpms (client and server). I just went to the following site for mysql 4.0 downloads and downloaded and installed the "libraries and header files" rpm, under "Linux x86 RPM downloads" section. I was installing under Fedora2.

http://dev.mysql.com/downloads/mysql/4.0.html

I got through the configure command successfully after that.
 [2007-06-28 13:49 UTC] thangaraj dot manogaran at gmail dot com
I am using php-5.2.3 and mysql 4.1.10 (default rpm package in RHE4 linux) and apache 2.2.4 in RHE4 64-bit linux machine.

I started the mysql by giving the command : service mysqld start
and mysql service is started.

I have configured php with apache.
But, while trying to configure Php with mysql i got errors.

The data directory of the mysql is /var/lib/
and mysql.sock is present in /var/lib/mysql/.

I tried configuring php with mysql with the following command:
./configure --with-mysql=/var/lib

But got the errors:

.........................................
..........................................
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for OpenSSL support... no
checking for Kerberos support... no
checking for PCRE support... yes
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined... no
checking whether to enable bc style precision math functions... no
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... no
checking if we should use cURL for url streams... no
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... (cached) yes
checking for uint32_t... (cached) yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... (cached) yes
checking for atoll... (cached) yes
checking for strftime... (cached) yes
checking whether to enable DBA... no
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable dbase support... no
checking whether to enable DOM support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable EXIF (metadata from images) support... no
checking for FrontBase SQL92 (fbsql) support... no
checking for FDF support... no
checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... no
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for GNU gettext support... no
checking for GNU MP support... no
checking whether to enable hash support... yes
checking whether byte ordering is bigendian... (cached) no
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking for iconv support... yes
checking for iconv... (cached) yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... no
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for InterBase support... no
checking whether to enable JavaScript Object Serialization support... yes
checking for ANSI C header files... (cached) yes
checking for LDAP support... no
checking for LDAP Cyrus SASL support... no
checking whether to enable multibyte string support... no
checking whether to enable multibyte regex support... yes
checking whether to check multibyte regex backtrack... yes
checking for external libmbfl... no
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
checking for mysql_close in -lmysqlclient... no
checking for mysql_errno in -lmysqlclient... no
configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.

I tried ./configure --with-zlib-dir --with-mysql 


But got the errors:

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking for OpenSSL support... no
checking for Kerberos support... no
checking for PCRE support... yes
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined... yes
checking for gzgets in -lz... (cached) yes
checking whether to enable bc style precision math functions... no
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... no
checking if we should use cURL for url streams... no
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... (cached) yes
checking for uint32_t... (cached) yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... (cached) yes
checking for atoll... (cached) yes
checking for strftime... (cached) yes
checking whether to enable DBA... no
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable dbase support... no
checking whether to enable DOM support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable EXIF (metadata from images) support... no
checking for FrontBase SQL92 (fbsql) support... no
checking for FDF support... no
checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... no
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for GNU gettext support... no
checking for GNU MP support... no
checking whether to enable hash support... yes
checking whether byte ordering is bigendian... (cached) no
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking for iconv support... yes
checking for iconv... (cached) yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... no
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for InterBase support... no
checking whether to enable JavaScript Object Serialization support... yes
checking for ANSI C header files... (cached) yes
checking for LDAP support... no
checking for LDAP Cyrus SASL support... no
checking whether to enable multibyte string support... no
checking whether to enable multibyte regex support... yes
checking whether to check multibyte regex backtrack... yes
checking for external libmbfl... no
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
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.

Please help me out in sorting this issue.
 [2007-08-10 20:37 UTC] username at hotmail dot com
I have experienced the same error message while compiling PHP 5.2.3 with MySQL 5.0.45.  I am running OS X 10.4.10.

When compiling with the line: --with-mysql-dir=/usr/local/mysql
I get the error: 
configure: error: Cannot find MySQL header files under yes.

When compiling with the line: --with-mysql=/usr/local/mysql
I get the error:
checking size of char *... configure: error: cannot compute sizeof (char *), 77

I have not yet resolved the issue, but I have tried older versions of MySQL 5 to no success.
 [2007-09-05 07:53 UTC] surface3 at tiscali dot it
Hi Guys, 
i've got the same problem with php-5.2.3 and mysql 5.0.45.
i've downloaded  MySQL-devel-community-5.0.45-0 and i 've solved my problem with configure 
bye
 [2007-11-06 12:33 UTC] anderan at suponix dot com
me help:
apt-get install libmysqlclient-dev
 [2007-11-09 14:41 UTC] dan at k dot ro
well on fedora core 6 is not working what a stupid bug this is!
 [2007-11-28 20:16 UTC] cizarr at gmail dot com
yep, this one will solve the problem as anderan wrote:
apt-get install libmysqlclient-dev

thanks man!
 [2009-02-15 07:26 UTC] gambitrex at hotmail dot com
hey, the apt-get install libmysqlclient-dev worked for me too :D
 [2009-08-28 20:59 UTC] danbrown@php.net
Looks like it's safe to close this out officially now.
 [2010-07-27 02:52 UTC] nazd at webmail dot co dot za
Description:
------------

Hi there Guys,

Im relatively new to Linux. Im having the same problem, difference is that I am using RedHat as my platform.
I was able to install Apache 2.2.11 using RPM.
This a virtual server I have created using VMware
I created the MySQL server using an app called Webmin.

When I attempt to install PHP5.2.13 using the command
./configure --prefix=/usr/lib/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/var/lib/mysql

I get the errors below:

Configuring extensions
checking size of long... (cached) 4
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... no
checking for Kerberos support... no
checking for PCRE support... yes
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined... no
checking whether to enable bc style precision math functions... no
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... no
checking if we should use cURL for url streams... no
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable dbase support... no
checking whether to enable DOM support... yes
checking for xml2-config path... (cached) /usr/bin/xml2-config
checking whether libxml build works... (cached) yes
checking whether to enable EXIF (metadata from images) support... no
checking for FrontBase SQL92 (fbsql) support... no
checking for FDF support... no
checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... no
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for GNU gettext support... no
checking for GNU MP support... no
checking whether to enable hash support... yes
checking whether byte ordering is bigendian... (cached) no
checking size of short... 2
checking size of int... (cached) 4
checking size of long... (cached) 4
checking size of long long... (cached) 8
checking for iconv support... yes
checking for iconv... yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... no
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for InterBase support... no
checking whether to enable JavaScript Object Serialization support... yes
checking for ANSI C header files... (cached) yes
checking for LDAP support... no
checking for LDAP Cyrus SASL support... no
checking whether to enable multibyte string support... no
checking whether to enable multibyte regex support... yes
checking whether to check multibyte regex backtrack... yes
checking for external libmbfl... no
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find MySQL header files under /var/lib/mysql.
Note that the MySQL client library is not bundled anymore!
[root@gets-dev-form2 php-5.2.13]#

I ran the command find / -name mysql.h
but found on header files. 

Running the command:
[root@gets-dev-form2 php-5.2.13]# service mysqld start
Starting MySQL:                                            [  OK  ]
[root@gets-dev-form2 php-5.2.13]#

MySql seems to start.

Can anyone please help?

Thanking you in advance.
 [2010-07-27 04:40 UTC] srinatar@php.net
-Assigned To: +Assigned To: srinatar
 [2010-07-27 04:40 UTC] srinatar@php.net
well, most likely what's happening is you have installed the 64-bit version of mysql package. i would suggest removing this package (using pkgrm) and then installing the 32-bit version of mysql package. 

this is a configuration issue and not a php bug

this should give you the clue  - which is telling you that the configurator is unable to compile 32-bit php with 64-bit mysql client:


ld: warning: file /usr/local/mysql//lib/libmysqlclient.a(libmysql.o): wrong ELF class: ELFCLASS64
Undefined			first referenced
 symbol  			    in file
mysql_close                         /var/tmp//ccYGWfaf.o
 [2010-07-27 05:13 UTC] srinatar@php.net
-Status: Closed +Status: Re-Opened
 [2010-07-27 05:13 UTC] srinatar@php.net
marking it as "bogus"
 [2010-07-27 05:13 UTC] srinatar@php.net
-Status: Re-Opened +Status: Bogus
 [2010-07-27 05:13 UTC] srinatar@php.net
"marking it as bogus for completeness"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 01:01:30 2024 UTC