469,576 Members | 1,681 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,576 developers. It's quick & easy.

Compiling PHP with mysql

Hi,
I got the following error while trying to compile php with mysql. I would be
glad if anyone can help me on this. Here is the error that i've got in
config.log

The command i used is:
../configure --prefix=/opt1/php.5.2.1 --with-oci8=instantclient,/opt1/oracle_instantclient_10_2
\

--with-apxs2=/spare/WWW2/bin/apxs --enable-sigchild --with-libxml-dir=/opt1/xml2
\

--with-config-file-path=/spare/WWW2/conf --with-mysql=/spare/mysql
\

--with-zlib-dir=/opt1/zlib

configure:57708: checking for MySQL support
configure:57754: checking for specified location of the MySQL UNIX socket
configure:57811: checking for MySQL UNIX socket location
configure:58001: checking for mysql_close in -lmysqlclient
configure:58020: gcc -o
onftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/spare/mysql/lib
-L/spare/mysql/lib -L/usr/lib -R/usr/ucblib -L/usr/ucblib -R/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4
-L/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4 -R/opt1/libxml2.2.6.27/lib
-L/opt1/libxml2.2.6.27/lib -R/opt1/zlib/lib -L/opt1/zlib/lib
conftest.c -lmysqlclient -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc -lxml2
-lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF
class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_close /var/tmp//ccdtPtSd.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 58009 "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:58241: checking for mysql_error in -lmysqlclient
configure:58260: gcc -o
onftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/spare/mysql/lib
-L/spare/mysql/lib -R/opt1/zlib/lib -L/opt1/zlib/lib -L/usr/lib -R/usr/ucblib
-L/usr/ucblib -R/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4 -L/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4
-R/opt1/libxml2.2.6.27/lib -L/opt1/libxml2.2.6.27/lib -R/opt1/zlib/lib -L/opt1/zlib/lib
-R/opt1/zlib -L/opt1/zlib
conftest.c -lmysqlclient -lz -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc -lxml2
-lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF
class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_error /var/tmp//ccwk7Kaa.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 58249 "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; }
Thank you,
Jagadish
Mar 28 '07 #1
5 2867
Jagadish Kumar, Maripi wrote:
Hi,
I got the following error while trying to compile php with mysql. I would be
glad if anyone can help me on this. Here is the error that i've got in
config.log

The command i used is:
./configure --prefix=/opt1/php.5.2.1 --with-oci8=instantclient,/opt1/oracle_instantclient_10_2
\

--with-apxs2=/spare/WWW2/bin/apxs --enable-sigchild --with-libxml-dir=/opt1/xml2
\

--with-config-file-path=/spare/WWW2/conf --with-mysql=/spare/mysql
\

--with-zlib-dir=/opt1/zlib

configure:57708: checking for MySQL support
configure:57754: checking for specified location of the MySQL UNIX socket
configure:57811: checking for MySQL UNIX socket location
configure:58001: checking for mysql_close in -lmysqlclient
configure:58020: gcc -o
onftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/spare/mysql/lib
-L/spare/mysql/lib -L/usr/lib -R/usr/ucblib -L/usr/ucblib -R/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4
-L/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4 -R/opt1/libxml2.2.6.27/lib
-L/opt1/libxml2.2.6.27/lib -R/opt1/zlib/lib -L/opt1/zlib/lib
conftest.c -lmysqlclient -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc -lxml2
-lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF
class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_close /var/tmp//ccdtPtSd.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 58009 "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:58241: checking for mysql_error in -lmysqlclient
configure:58260: gcc -o
onftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/spare/mysql/lib
-L/spare/mysql/lib -R/opt1/zlib/lib -L/opt1/zlib/lib -L/usr/lib -R/usr/ucblib
-L/usr/ucblib -R/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4 -L/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4
-R/opt1/libxml2.2.6.27/lib -L/opt1/libxml2.2.6.27/lib -R/opt1/zlib/lib -L/opt1/zlib/lib
-R/opt1/zlib -L/opt1/zlib
conftest.c -lmysqlclient -lz -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc -lxml2
-lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF
class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_error /var/tmp//ccwk7Kaa.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 58249 "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; }
Thank you,
Jagadish

Just a wild guess. Do you have more than one version of MySQL on your
system? It looks like it may be picking up headers from one version but
the lib from another one.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 28 '07 #2
No, I just have one version of mysql on the system and it is on
/spare/mysql/.
This is a Sun Solaris SPARC 9 machine. I have a guess but i'm not sure it is
the problem though. It is looking for MySQL Unix Socket but it doesn't find
it. Can anyone provide me information on this? or can help me in figuring
out the cause of the error.

Thank you,
Jagadish

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:mv******************************@comcast.com. ..
Jagadish Kumar, Maripi wrote:
>Hi,
I got the following error while trying to compile php with mysql. I would
be glad if anyone can help me on this. Here is the error that i've got in
config.log

The command i used is:
./configure --prefix=/opt1/php.5.2.1 --with-oci8=instantclient,/opt1/oracle_instantclient_10_2
\

--with-apxs2=/spare/WWW2/bin/apxs --enable-sigchild --with-libxml-dir=/opt1/xml2
\

--with-config-file-path=/spare/WWW2/conf --with-mysql=/spare/mysql
\

--with-zlib-dir=/opt1/zlib

configure:57708: checking for MySQL support
configure:57754: checking for specified location of the MySQL UNIX socket
configure:57811: checking for MySQL UNIX socket location
configure:58001: checking for mysql_close in -lmysqlclient
configure:58020: gcc -o
nftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/spare/mysql/lib
-L/spare/mysql/lib -L/usr/lib -R/usr/ucblib -L/usr/ucblib -R/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4
-L/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4 -R/opt1/libxml2.2.6.27/lib
-L/opt1/libxml2.2.6.27/lib -R/opt1/zlib/lib -L/opt1/zlib/lib
conftest.c -lmysqlclient -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc -lxml2
-lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong
ELF class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_close /var/tmp//ccdtPtSd.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 58009 "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:58241: checking for mysql_error in -lmysqlclient
configure:58260: gcc -o
nftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/spare/mysql/lib
-L/spare/mysql/lib -R/opt1/zlib/lib -L/opt1/zlib/lib -L/usr/lib -R/usr/ucblib
-L/usr/ucblib -R/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4 -L/opt/jmaripi/gcc/lib/gcc/sparc-sun-solaris2.9/4.0.4
-R/opt1/libxml2.2.6.27/lib -L/opt1/libxml2.2.6.27/lib -R/opt1/zlib/lib -L/opt1/zlib/lib
-R/opt1/zlib -L/opt1/zlib
conftest.c -lmysqlclient -lz -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc
-lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong
ELF class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_error /var/tmp//ccwk7Kaa.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 58249 "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; }
Thank you,
Jagadish

Just a wild guess. Do you have more than one version of MySQL on your
system? It looks like it may be picking up headers from one version but
the lib from another one.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Mar 28 '07 #3
Jagadish Kumar, Maripi wrote:
Hi,
I got the following error while trying to compile php with mysql. I would be
glad if anyone can help me on this. Here is the error that i've got in
config.log
What linux distribution?

this is the line I ussed on my Ubuntu:

#!/bin/bash

../configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-config-file-path=/etc \
--enable-track-vars \
--enable-ftp \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--enable-gd-native-ttf \
--enable-memory-limit \
--enable-trans-sid \
--enable-magic-quotes \
--enable-exif \
--enable-inline-optimization \
--enable-dbase \
--enable-mbstring \
--enable-embedded-mysqli \
--with-mysqli \
--with-gettext \
--with-gd \
--with-calendar=shared \
--with-apxs2=`which apxs2` \
--with-imap \
--with-ncurses \
--with-zlib-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-xpm-dir=/usr \
--with-openssl=/usr \
--with-freetype-dir=/usr/include \
--with-mysql=/usr \
--with-kerberos \
--with-imap-ssl

#
# --with-ldap \
# --with-ttf=/usr/X11R6 \
# --with-mm=/usr/mm-1.1.3 \
# --with-pgsql=/usr/local/pgsql \
# --with-pdflib=/usr/local \
#

make

echo -n "Remember to back up /etc/apache/httpd.conf first"
exit
checkinstall
--
iTech Consulting Services Limited
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
Mar 29 '07 #4
Hi,
Thanks for your reply. I am installing this on Sun Solaris SPARC 9.

Thank you,
Jagadish

"Man-wai Chang" <to***********@gmail.comwrote in message
news:46********@127.0.0.1...
Jagadish Kumar, Maripi wrote:
>Hi,
I got the following error while trying to compile php with mysql. I would
be glad if anyone can help me on this. Here is the error that i've got in
config.log

What linux distribution?

this is the line I ussed on my Ubuntu:

#!/bin/bash

./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-config-file-path=/etc \
--enable-track-vars \
--enable-ftp \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--enable-gd-native-ttf \
--enable-memory-limit \
--enable-trans-sid \
--enable-magic-quotes \
--enable-exif \
--enable-inline-optimization \
--enable-dbase \
--enable-mbstring \
--enable-embedded-mysqli \
--with-mysqli \
--with-gettext \
--with-gd \
--with-calendar=shared \
--with-apxs2=`which apxs2` \
--with-imap \
--with-ncurses \
--with-zlib-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-xpm-dir=/usr \
--with-openssl=/usr \
--with-freetype-dir=/usr/include \
--with-mysql=/usr \
--with-kerberos \
--with-imap-ssl

#
# --with-ldap \
# --with-ttf=/usr/X11R6 \
# --with-mm=/usr/mm-1.1.3 \
# --with-pgsql=/usr/local/pgsql \
# --with-pdflib=/usr/local \
#

make

echo -n "Remember to back up /etc/apache/httpd.conf first"
exit
checkinstall
--
iTech Consulting Services Limited
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288

Mar 29 '07 #5
Jagadish,

ld: warning: file /spare/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF
class: ELFCLASS64
Undefined first referenced
symbol in file
mysql_close /var/tmp//ccdtPtSd.o
This message here means that you're trying to build PHP as 32-bit, but your MySQL library is 64-bit.

You'll either need to build PHP in 64-bit (which means everything else that you link to needs to be 64-bit), or install the 32-bit
version of MySQL and point to it using LDFLAGS.

The 'file' command is your friend. Use it to determine what ELFCLASS your libraries are.

hth,
John
Mar 31 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Aliencat | last post: by
6 posts views Thread by Andres Rosado-Sepulveda | last post: by
reply views Thread by Vangelis Pappas | last post: by
reply views Thread by tyousaf | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.