2010年12月23日木曜日

x86_64编译安装PHP出现configure: error: mysql configure failed. Please check config.log的解决方法


编译PHP的时候出下面的错:
checking for mysql_close in -lmysqlclient… no
checking for mysql_error in -lmysqlclient… no
configure: error: mysql configure failed. Please check config.log for more information.
网络上说:安装PHP的时候没有指定一下mysql的安装目录。但是已经指定了,所以这个说法是错误的,其实主要原因是 mysql-level没有装,也就是mysql的版本不对,应该换
mysql-max-5.0.21版本(包含所有mysql相关内容的软件包)
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 59854 “configure”
#include “confdefs.h”
在看看config.log提示的错….哦.原来是版本有问题.想起我的系统都是X86的,lib都是64位的.所以解决方法很容易.
这个libmysqlclient.a library 是在 /usr/lib64/mysql, 不是在 /usr/lib/mysql.
所以可以做下面的方法来解决
#export LDFLAGS=-L/usr/lib64/mysql
OR
请将Makefile里面的
-L/usr/lib/mysql
改为
-L/usr/lib64/mysql

0 件のコメント:

コメントを投稿