首頁  >  文章  >  後端開發  >  linux安裝php 模組--with-mysql --with-mysqli非得要安裝mysql嗎

linux安裝php 模組--with-mysql --with-mysqli非得要安裝mysql嗎

WBOY
WBOY原創
2016-09-30 09:37:332024瀏覽

linux centos 環境下,安裝php.5.3
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --enable-soap - -enable-fpm --enable-mbstring
--with-curl --with-mysql -with-mysqli --with-gd --with-jpeg-dir

報錯:
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

有點不明白,with-mysql模組是支援mysql吧?非得在機器上安裝mysql嗎。因為機器是連接別的機器上的msyql,我只需要安裝支援mysql連線就可以了。有別的辦法嗎?

找到其它資料需要這些:mysql-server mysql-client libmysqlclient-dev

回覆內容:

linux centos 環境下,安裝php.5.3
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --enable-soap - -enable-fpm --enable-mbstring
--with-curl --with-mysql -with-mysqli --with-gd --with-jpeg-dir

報錯:
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

有點不明白,with-mysql模組是支援mysql吧?非得在機器上安裝mysql嗎。因為機器是連接別的機器上的msyql,我只需要安裝支援mysql連線就可以了。有別的辦法嗎?

找到其它資料需要這些:mysql-server mysql-client libmysqlclient-dev

你需要安裝 libmysqlclient-dev。這是 MySQL 用戶端程式庫的開發用檔案(頭檔、pkg-config 設定等)。它會依賴 libmysqlclient,它是 MySQL 客戶端函式庫,用於連接到 MySQL 伺服器的。

你要從某個系統連接 MySQL 伺服器(即使是遠端系統上的),你還是需要有 MySQL 用戶端函式庫,這樣你的程式才知道如何講 MySQL 所使用的語言(MySQL 網路協定)。當然有些函式庫並沒有使用 MySQL 官方的客戶端函式庫,而是自己實作一遍,這樣就不需要 MySQL 官方的客戶端函式庫了(如 pymysql)。

如提示,安裝libmysqlclient就可以了

應該只要有mysql-libs就可以。不過這個包的名字很多,像是mysql-community-libs

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn