php mysql.x86 64_X86_64编译安装PHP ,mysql configure failed.

好久没有编译安装过php了,为了玩nginx.没法子,编译一次来测试.我加的编译的参数是:

# ./configure --prefix=/usr/local/php --with-config-file-path=/etc --with-gd --enable-gd-native-ttf --with-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-debug --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt

没想到老是出下面的错

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.

google很久,都讲下面的答案,晕,这种也叫答案,那我不是还要重新编译一次mysql.这个php就很麻烦了.这个一定不对.

网查找说:安装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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值