PHP编译时报错error: mysql configure failed.以及/usr/bin/ld: cannot find -lmysqlclient

来源:互联网 发布:从java走向javaee 编辑:程序博客网 时间:2024/06/13 23:18

PHP编译过程中报错:

error: mysql configure failed. Please check config.log for more information.

不停百度,看日志,总算解决了。

日志的错误提示/usr/bin/ld: cannot find -lmysqlclient

#/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.so when searching for -lmysqlclient#/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.a when searching for -lmysqlclient#/usr/bin/ld: cannot find -lmysqlclient

先去了/usr/local/mysql/lib/libmysqlclient.so没找到lmysqlclient。

解决办法:

# yum -y install MySQL-devel

还不够,这只是为了在/usr/lib64下产生一个mysql文件夹。然后做一个软链接:

# cd /usr/local/mysql# mv lib lib.bak# ln -s /usr/lib64/mysql /usr/local/mysql/lib

或者把原有的lib备份,(/usr/local/mysql/lib),然后将/usr/lib64/mysql复制到替换它。搞定

如果还没有解决:

mysql相关rpm的64位版除了server之外都装了一遍

也是一个不错的办法哦!

阅读全文
0 0