编译安装PHP出现configure: error: MySQL configure failed. Please check config.log的解决方法
以下為google的結(jié)果:
方案一:
轉(zhuǎn)載鏈接:http://www.php-oa.com/2008/03/28/php-make.html
好久沒有編譯安裝過php了,為了玩nginx.沒法子,編譯一次來測試.我加的編譯的參數(shù)是:
沒想到老是出下面的錯
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就很麻煩了.這個一定不對.
網(wǎng)查找說:安裝PHP的時候沒有指定一下mysql的安裝目錄.但是我已經(jīng)指定了,所以這個說法是錯誤的,其實主要原因是 mysql-level沒有裝,也就是mysql的版本不對,應(yīng)該換
mysql-max-5.0.21版本(包含所有mysql相關(guān)內(nèi)容的軟件包)
/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提示的錯….哦.原來是版本有問題.想起我的系統(tǒng)都是X86的,lib都是64位的.所以解決方法很容易.
這個libmysqlclient.a library 是在 /usr/lib64/mysql, 不是在 /usr/lib/mysql.
所以可以做下面的方法來解決
OR
請將Makefile里面的
-L/usr/lib/mysql
改為
-L/usr/lib64/mysql
方案二:
轉(zhuǎn)載鏈接:http://blog.csdn.net/wlx3351/article/details/5938964
AS5 X64下?php-5.3.3編譯時出現(xiàn)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
?
請確認(rèn)是否安裝
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和系統(tǒng)位數(shù):http://blog.csdn.net/eiyaa/article/details/4184353
總結(jié):上面的方法不一定是可以解決你的問題,具體要看php編譯目錄中的config.log中提示什么錯誤。
像我的提示:con't find -ltdl libraries ...
解決方法:apt-get install libltdl-dev
總結(jié)
以上是生活随笔為你收集整理的编译安装PHP出现configure: error: MySQL configure failed. Please check config.log的解决方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阴阳师模型提取
- 下一篇: Linux调试智能卡环境搭建(二),其中