473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=instantcli ent,/opt1/oracle_instantc lient_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 3070
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=instantcli ent,/opt1/oracle_instantc lient_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*******@attgl obal.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*******@attg lobal.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=instantcli ent,/opt1/oracle_instantc lient_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:5770 8: checking for MySQL support
configure:5775 4: checking for specified location of the MySQL UNIX socket
configure:5781 1: checking for MySQL UNIX socket location
configure:5800 1: checking for mysql_close in -lmysqlclient
configure:5802 0: 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:5824 1: checking for mysql_error in -lmysqlclient
configure:5826 0: 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*******@attgl obal.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1779
by: Aliencat | last post by:
I'm having issues compiling php v4.2.2 on Redhat 9.0. The goal ultimately is to compile in mcrypt support, but that's a bit down the road from here. I've chased down the dependencies for the configure options below (I think), but it still won't configure. It appears to be choking on MySql (v3.23.54). The error I get is something like: /usr/bin/ld : cannot find -lmysqlclient
6
6913
by: Andres Rosado-Sepulveda | last post by:
Hello, I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error message it is showing: -- start -- Undefined first referenced symbol in file php_parse_date ext/standard/datetime.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
0
1893
by: yzzzzz | last post by:
Hi, I am compiling PHP 5.0.2 myself with MySQL support. I did a ./configure --with-mysqli=/usr/local/mysql/bin/mysql_config (see end of post for complete configure) Note: I also have --with-mysql=/usr/local/mysql/. However, I get the same errors when I configure without the mysql extension, just mysqli. And as the documentation says, I use the same version of MySQL for both extensions to avoid conflicts.
6
6179
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with itself. Everything you need is available at no costs (except download hassle and installation time). Once your system is set up properly its just a matter of running 'python setup.py build'. No longer waiting for someone else to build binaries and a...
0
566
by: julio | last post by:
------=_NextPart_000_0019_01C2D0F9.BFBD6610 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello There, I try to compiling Mysql V4.0 in the Alpha/Tru64 Unix V5.1a. I have installed in the Alpha C++ and C version 6.5, and gcc 3.3 and GNU MAKE 3.8.
0
1568
by: tevans | last post by:
I'm using Slackware GNU/Linux 9.0 on an Intel PII 266 machine that's SMP capable, but only with one CPU installed, and 64MB of RAM. It's basically a small test system that I play around with in some free time before installing things on my larger systems. I am trying to do a fresh install of MySQL 4.0.14 (I removed the previous 3.23.56 installation, including directory structure and leftover components). I'm compiling with these options...
0
3038
by: Vangelis Pappas | last post by:
I am hopping to get mysql compiled for arm in an i386 redhat pc. I have the cross compiler and some arm distribution, the version of the gcc is 2.95.3, and mysql distribution is 3.23.57. (I also tried 4.0.14 withthe same results/error) I do a: ../configure --prefix=/usr/local/arm/arm-linux --host=arm-linux --build=i386-linux
0
2398
by: tyousaf | last post by:
Hi i am new to mysql and mysql++, i have installed mysql server, it is running fine. i also installed "mysql++-1.7.9gcc3.2-2.i386.rpm" (i have gcc 3.3) , first of all as the readme file says to do automake, if i do that in the proper director it says "automake: 'configure.ac' or 'configure.in' is required" i dont know where to bring those files. secondly if i only compile simple1.cc using gcc proving all the link flags to libraries and...
2
995
by: Teo | last post by:
Hey guys!!! I am working on an application that uses a MySQL Database as a back end. When compiling my application which would be the best way to prepare the database for deployment on the customer's end? I am planning on having a single server store de Mysql data and the application installed on several clients for data handling. Any suggestion is greatly appreciated. Thanks much, Teo
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.