2011-07-17 154 views
5

我得到以下錯誤: 致命錯誤:類「mysqli的」在我的PHP腳本 我已經php5.3.3-7安裝沒有發現,我得到這個,當我運行apt-cache顯示PHP5-MySQL的Mysqli沒有安裝?

Description: MySQL module for php5 
This package provides modules for MySQL database connections directly from 
PHP scripts. It includes the generic "mysql" module which can be used 
to connect to all versions of MySQL, an improved "mysqli" module for 
MySQL version 4.1 or later, and the pdo_mysql module for use with 
the PHP Data Object extension. 

在php info中沒有關於mysql的信息。 我如何找到延伸,我必須去找它嗎? 在我的php.ini中有許多對mysqli的引用。但有些錯誤。

+2

可能的重複[致命錯誤:'MySQLi'類未找到](http://stackoverflow.com/questions/666811/fatal-error-class-mysqli-not-found) – genesis

+1

不是重複的; OP不需要手動安裝MySQLi。 – womble

回答

16

你真的安裝了php5-mysql包嗎? apt-cache show會爲您提供未安裝軟件包的信息(您希望dpkg -l列出已安裝的軟件包)。如果安裝了該軟件包,請仔細檢查它是否已啓用(/etc/php5/conf.d/mysql.ini是需要查看的地方)。

+1

謝謝。它現在沒有安裝.Works。 – mike628

+0

這個讓我感到很蠢,但是我的盒子裏甚至都沒有安裝mysql。謝謝! – michaelday

+0

我其實來這裏尋找要安裝哪個軟件包:'php5-mysql'或'php5-mysqlnd'。後者使用「本地驅動程序」,無論如何。我應該使用哪一個?我正在使用Debian stretch,本地驅動程序是由Oracle提供的封閉源代碼還是什麼? – Luc

2

聽起來像你只需要install MySQLi

如果你覺得你這樣做,仍然有問題,請發表您的操作系統和其他任何可能幫助

0

我不得不重新安裝,以擺脫這種錯誤的:

apt-get remove php5.6-mysql 
apt-get install php5.6-mysql