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

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

2009年04月20号
查看评论 发表评论 1,024次浏览

编译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

类别PHP 标签
  1. admin
    发表于 2009年04月20号 10时38分51秒 | 1楼

    解决方法:

      如果是自己选择GZ包安装的MYSQL。这里要加路径。

      加的方法为–with-mysql-dir=/user/local/mysql

      切记不可写为:–with-mysql=/user/local/mysql

  2. admin
    发表于 2009年04月20号 10时49分25秒 | 2楼

    不过一般不要加

  3. dwight howard shoes
    发表于 2010年06月15号 04时47分48秒 | 3楼

    history again.

  4. Mbt Shoes
    发表于 2010年06月23号 09时25分22秒 | 4楼

    it is painting with words.

  5. Chanel Handbags online
    发表于 2010年06月24号 12时11分15秒 | 5楼

    Great to celebrate friendship like this!

  6. mbt shoes clearance
    发表于 2010年07月19号 22时02分46秒 | 6楼

    Thinking of you!

  7. kobe zoom iv
    发表于 2010年07月20号 10时37分01秒 | 7楼

    These words seem particularly poignant for me today.

  1. 目前没有通告