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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11134220/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 23:49:21  来源:igfitidea点击:

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

phpubuntuinstallation

提问by farzam

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

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

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

EDIT1:我最小化了配置命令,所以它只关注mysql。我也在运行 64 位版本的 ubuntu。

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

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

回答by farzam

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

感谢@hakre 的帮助。这是我使用的命令,它有效:

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

回答by Brongadier

Maybe for some poor soul this will work:

也许对于一些可怜的灵魂来说,这会奏效:

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

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