Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find libmysqlclient under /usr. while build PHP 5.2 from source on Ubuntu 12.4

I was trying to build PHP 5.2.17 from source on Ubuntu 12.4 64bit using this configuration:

./configure --prefix=/opt/php5.2 --with-config-file-path=/opt/php5.2 --with-mysql 

but I keep getting this error:

configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

Any Idea how to resolve this?

EDIT1: I minimized the configure command so it just focuses to mysql. also I'm running a 64bit version of ubuntu.

EDIT2: tried running ldconfig -v |grep mysql and here is the output

# ldconfig -v |grep mysql
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Cannot stat /usr/lib/x86_64-linux-gnu/libnss_db.so: No such file or directory
libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
libmysqlpp.so.3 -> libmysqlpp.so.3.1.0
like image 503
farzam Avatar asked Jun 21 '12 08:06

farzam


2 Answers

Thanx @hakre for the assistance. here is the command I used and it works:

sudo ./configure --prefix=/opt/php5.2 --with-config-file-path=/opt/php5.2 --with-mysql --with-libdir=/lib/x86_64-linux-gnu
like image 154
farzam Avatar answered Oct 20 '22 09:10

farzam


Maybe for some poor soul this will work:

./configure --with-apxs2=/usr/sbin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd

like image 31
Brongadier Avatar answered Oct 20 '22 09:10

Brongadier