<checking for mysql_config not found>,mysqlnotfound

來源:互聯網
上載者:User

<checking for mysql_config not found>,mysqlnotfound

php 5.3.29編譯安裝排錯:

 

 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-pdo-mysql=/usr/loca/mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session  --with-curl --enable-ctype

 

錯誤:

 

 

我找了很多方法,但都沒解決:

1、這種很接近,但不明確,還是讓人蒙圈。

這個由於在編譯的時候指定了 ‘ --with-pdo-mysql ’ 選項,但它並沒有找到 mysql 的安裝目錄,因此只用指定 mysql 的安裝目錄就可以了  '--with-pdo-mysql=/usr/local/mysql'

2、這種完全不沾邊,錯誤的。

1)sudo ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
將mysql_confi從你的安裝目錄連結到/usr/local/bin目錄下,這樣就可以在任意目錄下訪問了(也可以放到/usr/bin)
      2)編輯源碼檔案夾的site.cfg檔案,去掉#mysql_config = /usr/local/bin/mysql_config前的注釋#,修改後面的路徑為你的mysql_config真正的目錄就可以了。(如果不知道mysql_config在哪裡,運行命令:whereis mysql_config)

3、和第二種一樣的想法,也是錯誤的。

 

執行

 

ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config

 

將mysql_config連結到/usr/local/bin目錄下

4、我感覺有點可能。

yum install mysl   mysql-devel 

5、有一篇說背人的部落格寫的都是錯的,安裝這2個包就可以解決,他自己試過,但是沒解決我的問題。

 

MySQL-shared-compat-5.5.40-1.el6.x86_64.rpm

MySQL-shared-5.5.40-1.el6.x86_64.rpm

mysql-embedded-devel-5.1.73-3.el6_5.x86_64

 

下面來說下我的最簡單,直接有效辦法:

 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-pdo-mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session  --with-curl --enable-ctype

 

報錯是因為mysql安裝這個外掛程式時,按指定的路徑找不到。我們幹嘛要去幹預呢,直接為空白,讓它自己搜尋找去,這樣不就好了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.