Hi there, I’ve been working through your book “Build Your Own Database Driven Website Using PHP & MySQL”, and I am currently trying to install PHP + Apache + MySQL on Ubuntu Linux 10.04.
I’ve followed the given instructions exactly, but when I attempt to configure PHP with the command:
But I am given this error during the configuration process:
wrong mysql library version or lib not found. Check
config.log for more information.
Here is what the last lines of config.log say:
configure:60081: checking for MySQL support
configure:60128: checking for specified location of the MySQL UNIX socket
configure:61334: checking for MySQLi support
configure:61381: checking whether to enable embedded MySQLi support
configure:61535: checking for mysql_set_server_option in -lmysqlclient
configure:61554: gcc -o conftest -I/usr/include -g -O2 -fvisibility=hidden -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/lib -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc conftest.c -lmysqlclient -lm -ldl -lnsl -lxml2 -lxml2 1>&5
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 61543 "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_set_server_option();
int main() {
mysql_set_server_option()
; return 0; }
Please help, I have attempted this multiple times now, and I am no “n00b” when it comes to programming.
The latest versions PHP 5.2+ to 5.3+ come bundled with MySQL Native Drive so you wouldn’t need to install or link against MySQL’s supplied Client Library. (That was what you were doing, btw.)