php mysqli没有安装?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6723742/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mysqli not installed?
提问by mike628
I get the following error: Fatal error: Class 'mysqli' not found in my php script I have php5.3.3-7 installed and I get this when I run apt-cache show php5-mysql
我收到以下错误:致命错误:在我的 php 脚本中找不到类 'mysqli' 我安装了 php5.3.3-7,当我运行 apt-cache show php5-mysql 时得到这个
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.
There is nothing about mysql at all in php info. How do I find the extention and do I have to istall it? There are many references to mysqli in my php.ini. But something is wrong.
在 php 信息中根本没有关于 mysql 的内容。我如何找到扩展名,我是否必须安装它?在我的 php.ini 中有很多对 mysqli 的引用。但有些不对劲。
回答by womble
Have you actually installed the php5-mysql
package? apt-cache show
will give you information on packages that aren't installed (you want dpkg -l
to list installed packages). If the package is installed, double-check that it's enabled (/etc/php5/conf.d/mysql.ini
is the place to look).
你真的安装了这个php5-mysql
包吗? apt-cache show
将为您提供有关未安装的软件包的信息(您要dpkg -l
列出已安装的软件包)。如果安装了软件包,请仔细检查它是否已启用(/etc/php5/conf.d/mysql.ini
是查看的地方)。
回答by genesis
Sounds like you just need to install MySQLi.
听起来你只需要安装 MySQLi。
If you think you've done that and still have a problem, please post your operating system and anything else that might help
如果你认为你已经这样做了但仍然有问题,请发布你的操作系统和其他任何可能有帮助的东西
回答by l0pan
I had to reinstall it to get rid of this error:
我不得不重新安装它以摆脱此错误:
apt-get remove php5.6-mysql
apt-get install php5.6-mysql