日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

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

發布時間:2023/12/9 数据库 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 编译安装PHP出现configure: error: MySQL configure failed. Please check config.log的解决方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

以下為google的結果:

方案一:

轉載鏈接:http://www.php-oa.com/2008/03/28/php-make.html

好久沒有編譯安裝過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


    方案二:

    轉載鏈接: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的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。