Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

在rhel5.3 linux下编译PHP5-2.10 出现连接mysql 错误

[复制链接]
brianzzz 发表于 2009-9-3 16:13:11 | 显示全部楼层 |阅读模式
本帖最后由 brianzzz 于 2009-9-3 16:25 编辑

在rhel5.3 linux下编译PHP-5.2.9 出现连接mysql 错误如下:
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... /var/lib/mysql/mysql.sock
checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
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.

连接库的问题吧,但是,怎么才能解决呀?这是在./configure 时就出现了,查了很多资料都无法解决。跪求高手指点~~
 楼主| brianzzz 发表于 2009-9-3 16:15:37 | 显示全部楼层
在PHP的config.log中的信息如下

configure:60047: checking for mysql_close in -lmysqlclient
configure:60066: gcc -o conftest -I/usr/include -g -O2  -Wl,-rpath,/usr/local/mysql-max-5.0.27-linux-i686-glibc23/lib -L/usr/local/mysql-max-5.0.27-linux-i686-glibc23/lib -L/usr/lib  -Wl,-rpath,/usr/kerberos/lib64 -L/usr/kerberos/lib64 -Wl,-rpath,/usr/local/gd2/lib -L/usr/local/gd2/lib -Wl,-rpath,/usr/local/libmcrypt/lib -L/usr/local/libmcrypt/lib conftest.c -lmysqlclient  -lmcrypt -lltdl -lgd -lfreetype -lpng -lz -ljpeg -lbz2 -lz -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz 1>&5
/usr/bin/ld: skipping incompatible /usr/local/mysql-max-5.0.27-linux-i686-glibc23/lib/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/../lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60055 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:60289: checking for mysql_error in -lmysqlclient
configure:60308: gcc -o conftest -I/usr/include -g -O2  -Wl,-rpath,/usr/local/mysql-max-5.0.27-linux-i686-glibc23/lib -L/usr/local/mysql-max-5.0.27-linux-i686-glibc23/lib -L/usr/lib  -Wl,-rpath,/usr/kerberos/lib64 -L/usr/kerberos/lib64 -Wl,-rpath,/usr/local/gd2/lib -L/usr/local/gd2/lib -Wl,-rpath,/usr/local/libmcrypt/lib -L/usr/local/libmcrypt/lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient  -lz -lmcrypt -lltdl -lgd -lfreetype -lpng -lz -ljpeg -lbz2 -lz -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz 1>&5
/usr/bin/ld: skipping incompatible /usr/local/mysql-max-5.0.27-linux-i686-glibc23/lib/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib/../lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: skipping incompatible /usr/lib64/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 60297 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }
回复

使用道具 举报

 楼主| brianzzz 发表于 2009-9-3 16:18:41 | 显示全部楼层
在../lib64/libmysqlclient.*中貌似不能找到 -lmysqlclient   请教怎么才能正常编译?需要做什么修改呀?
回复

使用道具 举报

 楼主| brianzzz 发表于 2009-9-3 16:20:43 | 显示全部楼层
数据库用的是mysql-max-5.0.27-linux-i686-glibc23
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-17 10:59 , Processed in 0.032842 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表