Hello,
I'm trying to compile PHP 5.3.6 with Apache2 and MySql 5.5.12. I hit a problem that I can't seem to resolve by myself and I could not find a solution on the web.
It looks like Apache and MySql installed ok, I can start/stop them with no problem.
When I try to compile PHP the configure script fails with the error related to MySql.
# ./configure --with--apxs2=/usr/apache2/bin/apxs --with-mysql --with-zlib-dir=/usr/local/zlib
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.
# more config.log
. . . . . . . . .
configure:59920: gcc -o conftest -I/usr/include -g -O2 -D_POSIX_PTHREAD_SEMANTICS -L/usr/lib -R/usr/ucblib -L/usr/ucblib -R/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3 -L/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3 -R/usr/local/zlib/lib -L/usr/local/zlib/lib conftest.c -lmysqlclient -lz -lrt -lm -lnsl -lsocket -lgcc -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl 1>&5
ld: fatal: file /usr/lib/libmysqlclient.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 59909 "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();
It looks to me that the problem is related to the face that MySql was compiled for 64 bits since the error says "wrong ELF class: ELFCLASS64"
On the web I found recommendations to include option -with-libdir=/usr/lib64
but /usr/lib64 does not exist on my workstation. In fact lib64 cannot be found anywhere on my hard drive.
I can't believe that I'm the first person facing this problem. Does anyone have experience with this?
Thank You,
Pavel.