找不到的libmysqlclient / usr下。 而从源在Ubuntu 12.4构建PHP

2019-07-30 01:32发布

我试图建立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。 还我运行Ubuntu的64位版本。

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

Answer 1:

感谢名单@hakre的援助。 这里是我使用的命令和它的工作原理:

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


Answer 2:

也许对于一些可怜的灵魂这将工作:

的./configure --with-apxs2 = / usr / sbin目录/ apxs的--with-的MySQL = mysqlnd --with-的mysqli = mysqlnd --with-PDO-的MySQL = mysqlnd



文章来源: Cannot find libmysqlclient under /usr. while build PHP 5.2 from source on Ubuntu 12.4