以下为google的结果:

方案一:

转载链接:http://www.php-oa.com/2008/03/28/php-make.html

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

  1. # ./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.
所以可以做下面的方法来解决

  1. #export LDFLAGS=-L/usr/lib64/mysql

OR
请将Makefile里面的
-L/usr/lib/mysql
改为
-L/usr/lib64/mysql

方案二:

转载链接:http://blog.csdn.net/wlx3351/article/details/5938964

AS5 X64下 php-5.3.3编译时出现configure: error: mysql configure failed.

是由于64位引起的

处理办法:

ln -s /usr/lib64/mysql/ /usr/local/lib/mysql
ln -s /usr/include/mysql/ /usr/local/include/mysql

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib=/usr/local/zlib --with-gd=/usr/local/gd -with-png-dir=/usr/local --with-jpeg-dir=/usr --with-freetype-dir=/usr/local --enable-mbstring --with-mysql=/usr/local --with-xml

请确认是否安装

mysql-5.0.22-2.2.el5_1.1.x86_64.rpm   也可以用mysql-5.0.22-2.1.x86_64.rpm

mysql-devel-5.0.22-2.2.el5_1.1.x86_64.rpm   也可以用 mysql-devel-5.0.22-2.1.x86_64.rpm

查看CPU和系统位数:http://blog.csdn.net/eiyaa/article/details/4184353

总结:上面的方法不一定是可以解决你的问题,具体要看php编译目录中的config.log中提示什么错误

像我的提示:con't find -ltdl libraries ...

解决方法:apt-get install libltdl-dev

编译安装PHP出现configure: error: MySQL configure failed. Please check config.log的解决方法相关推荐

  1. clang++.exe: error: linker command failed with exit code 1 错误解决方法

    clang++.exe: error: linker command failed with exit code 1 错误解决方法 错误信息如下: Build command failed. Erro ...

  2. wdcp mysql 安装失败_解决WDCP安装错误Install Error:mysql configure err

    解决WDCP安装错误Install Error:mysql configure err 2018-09-22 安装WDCP出现报错: Install Error:mysql configure err ...

  3. configure: error: MySQL library not found ,Not found mysqlclient library

    在安装zabbix过程中遇到依赖问题 报错如下 configure: error: MySQL library not found 解决办法 rpm -ivh MySQL-devel-5.6.27-1 ...

  4. wdcp mysql configure error_install Error: mysql configure err

    安装的时候显示install Error: mysql configure err,怎么都无法解决,系统时间正常,我的系统是centos 5.9 64位的,gcc也更新了,求帮助啊.rpm安装也不成功 ...

  5. PhP 常见安装错误configure error xml2-config not found. please check your libxml2 installation

    编译PHP的时候报错: 安装 PHP 5.4.3 报 configure error xml2-config not found. please check your libxml2 installa ...

  6. 安装php时,configure: error: xml2-config not found. Please check your libxml2 installation

    参考文章:http://blog.csdn.net/anljf/article/details/6981247 安装php时的报错 configure: error: xml2-config not ...

  7. configure: error: xml2-config not found. Please check your libxml2 installation

    安装php时的报错 checking libxml2 install dir... no checking for xml2-config path...  configure: error: xml ...

  8. “ Error:(1, 1) java: 非法字符: ‘\ufeff‘ ”错误的解决方法

    前言:今天为了做作业,在 github 上面下载了个项目,然后在运行项目时发现报错,在此记录一下 " Error:(1, 1) java: 非法字符: '\ufeff' "错误的解 ...

  9. Java 链接MySQL数据库时报的connect和denied错解决方法

    2019独角兽企业重金招聘Python工程师标准>>> 一.not allowed to connect to this MySQL server错误 错误分析:可能是由于MySQL ...

最新文章

  1. [置顶] 自己动手实现OpenGL-OpenGL原来如此简单(二)
  2. 一些经典的常用ASP代码[经典简单] (2)
  3. YBTOJ危桥通行洛谷P3163:危桥通行(网络流)
  4. 核心交换机相对于普通交换机的优势
  5. 为什么强烈禁止开发人员使用isSuccess作为变量名
  6. 如何去掉html body里的 nbsp,html的空格和nbsp怎么去除?
  7. 消息中间件在分布式系统中的作用及介绍
  8. 什么是 WebAssembly?
  9. 开发环境配置(netbeans+ant迁移到eclipse+maven)
  10. 勤能补拙 VS 思考补拙
  11. HTML,CSS,font-family: 中文字体的英文名称 (宋体 微软雅黑 的英文写法)
  12. SolidWorks的发展历史(1994~2007)
  13. 延时调用的时候要注意
  14. 华为H3CNE认证题库、教材-热门下载帖汇总!
  15. curl检测网页的用法
  16. 软件设计模式——建造者模式
  17. Swift ——String 与 Array
  18. 互联网成数据宝库,网络数据采集技术推动人工智能发展
  19. 最大疯子树-树形dp+换根+二次扫描
  20. K序列--埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛

热门文章

  1. 隐藏网页文件的后缀(IIS测试通过)!
  2. JavaScript操作表格进行拖拽排序
  3. 主机无法连接虚拟机中的redis服务
  4. 解压ubi文件_Linux 文件压缩与解压相关
  5. java 封装 继承 堕胎_Java的继承、封装和多态
  6. 后端技术:这35 个细节,提升你的 Java 代码质量
  7. 程序员幽默:伤不起,我就是这样的程序员
  8. 2017年,软件开发全过程,描述得不能再详细了
  9. mysql分区列要包含主键吗_MYSQL的分区字段,必须包含在主键字段内
  10. STM32 时钟系统