Frustrating Day!! Php 5.0.4 + mysql 4.1.10a + mysqli + problems

Today I encountered some problems compiling mysqli into php 5.0.4.. Very aggrevating I must say… After alot of search around it appears to be a problem with the mysql libs that come in the rpm packages.

example error:

: multiple definition of `net_realloc’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x100): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x180): In function
`net_clear’:
: multiple definition of `net_clear’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x180): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x1f0): In function
`net_flush’:
: multiple definition of `net_flush’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x1f0): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x580): In function
`net_real_write’:
: multiple definition of `net_real_write’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x580): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x240): In function
`my_net_write’:
: multiple definition of `my_net_write’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x240): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x320): In function
`net_write_command’:
: multiple definition of `net_write_command’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x320): first defined here
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x9c0): In function
`my_net_read’:
: multiple definition of `my_net_read’
/usr/lib/mysql/libmysqlclient.a(net.o)(.text+0x9c0): first defined here
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1

Fix:

Run your configure line, edit the Make file, find the following line:

EXTRA_LIBS = -lcrypt -lcrypt -lmysqlclient -lpng -lz -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lmysqlclient -lcrypt -lnsl -lm -lz -lnss_files -lnss_dns -lresolv -lnss_files -lnss_dns -lresolv -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt

rmove the second “-lmysqlclient”, save the file and run make and make install as usual.

 

 

 

 

Top