Home > Archive > PHP Programming > March 2007 > Compiling PHP with mysql
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Compiling PHP with mysql
|
|
| Jagadish Kumar, Maripi 2007-03-28, 7:00 pm |
| 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
| |
| Jerry Stuckle 2007-03-28, 7:00 pm |
| 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.
jstucklex@attglobal.net
==================
| |
| Jagadish Kumar, Maripi 2007-03-28, 7:00 pm |
| 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" <jstucklex@attglobal.net> wrote in message
news:mvGdnUFtNeR6VJfbnZ2dnUVZ_rTinZ2d@co
mcast.com...
> Jagadish Kumar, Maripi wrote:
>
> 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.
> jstucklex@attglobal.net
> ==================
| |
| Man-wai Chang 2007-03-29, 7:00 pm |
| 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
| |
| Jagadish Kumar, Maripi 2007-03-29, 7:00 pm |
| Hi,
Thanks for your reply. I am installing this on Sun Solaris SPARC 9.
Thank you,
Jagadish
"Man-wai Chang" <toylet.toylet@gmail.com> wrote in message
news:460b836f$1@127.0.0.1...
> Jagadish Kumar, Maripi wrote:
>
> 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
| |
| John Cecere 2007-03-31, 6:58 pm |
| 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
|
|
|
|
|