PHP

configure: error: Cannot find libmysqlclient under /usr

安装php报以下错误:checking for specified location of the MySQL UNIX socket… no configure: error: Cannot find libmysqlclient under /usr. Note that the MySQL client library is not bundled anymore!
已邀请:

OpenSkill - OpenSkill官方账号

1、查找libmysqlclient* 如果没有这安装mysql client
2、如果有则在/etc/ld.so.conf 中添加libmysqlclient的查找路径
# find / -name libmysqlclient*
/usr/lib64/mysql/libmysqlclient.so
/usr/lib64/mysql/libmysqlclient.so.16
/usr/lib64/mysql/libmysqlclient.so.16.0.0
/usr/lib64/mysql/libmysqlclient_r.so
/usr/lib64/mysql/libmysqlclient_r.so.16
/usr/lib64/mysql/libmysqlclient_r.so.16.0.0

3、在usr下建立mysql lib的目录 将libmysql复制进去即可
mkdir -p /usr/lib/mysql/
cp /usr/lib64/mysql/* /usr/lib/mysql/

方案二:
在编译的时候直接将mysql 的路径指向mysql的真实安装路劲。
./configure –prefix=/usr/local/php
–with-freetype-dir=/usr/local/freetype/include/freetype2
–with-mysql=/data/server/mysql/server –with-mysqli
–enable-fpm –enable-exif –enable-ftp –enable-mbstring
–with-pdo-mysql –enable-soap –enable-zip –with-gd
–with-curl –with-jpeg-dir –enable-sockets
–with-xmlrpc –with-zlib

要回复问题请先登录注册