在/ usr下找不到libmysqlclient。在Ubuntu 12.4上从源代码构建PHP 5.2

时间:2012-06-21 08:23:13

标签: php ubuntu installation

我尝试使用此配置从PHP 5.2.17上的源代码构建Ubuntu 12.4 64bit

./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!

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

EDIT1:我最小化了configure命令,所以它只关注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

2 个答案:

答案 0 :(得分:18)

Thanx @hakre寻求帮助。 这是我使用的命令,它起作用:

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

答案 1 :(得分:4)

也许对于一些可怜的灵魂来说,这会起作用:

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