在/ usr下找不到libmysqlclient。 同时在Ubuntu 12.4上从源代码构buildPHP 5.2

我正在尝试使用此configuration在Ubuntu 12.4 64bit上从源代码构buildPHP 5.2.17

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

但我不断收到这个错误:

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

任何想法如何解决这个问题?

编辑1:我最小化了configuration命令,所以它只是集中到MySQL。 另外我正在运行一个64位版本的Ubuntu。

EDIT2:试着运行ldconfig -v |grep mysql ,这里是输出

 # 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 

Thanx @hakre的帮助。 这里是我使用的命令,它的工作原理:

 sudo ./configure --prefix=/opt/php5.2 --with-config-file-path=/opt/php5.2 --with-mysql --with-libdir=/lib/x86_64-linux-gnu 

也许对于一些可怜的灵魂来说,

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