php 如何在 XAMPP 上启用 mysqli?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12170400/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 02:58:28  来源:igfitidea点击:

How to enable mysqli on XAMPP?

phpmysqlixampp

提问by funtime

By seeing suggestions throughout the Internet I tried to convert all my queries to mysqli.

通过查看整个 Internet 上的建议,我尝试将所有查询转换为 mysqli。

But mysqli is not working in my XAMPP. I checked my PHP folder and there is a php_mysqli.dllfile... still it doesn't work

但是 mysqli 在我的 XAMPP 中不起作用。我检查了我的 PHP 文件夹并且有一个php_mysqli.dll文件...仍然不起作用

回答by Furry

Have you declare it to php.ini to load it? If no, try find this in php.ini and add php_mysqli.dll

你有没有把它声明到 php.ini 来加载它?如果没有,请尝试在 php.ini 中找到它并添加 php_mysqli.dll

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; ... or with a path:
;
;   extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

extension= php_mysqli.dll

回答by Bibhu S.

Goto the directory phpMyAdmin, find there is a file with name config.inc.php, open the file and find a line there as:
$cfg['Servers'][$i]['extension'] = 'mysql';
just change mysqlto mysqli.

转到目录phpMyAdmin,找到一个名为 nameconfig.inc.php的文件,打开文件并在那里找到一行:
$cfg['Servers'][$i]['extension'] = 'mysql';
只需更改mysqlmysqli.

回答by Daan

Another thing that might be blocking the msqli dll from loading could be user right issues on your local webserver, make sure the \User can read the ext folder, that was what worked for me

另一件可能阻止 msqli dll 加载的事情可能是本地网络服务器上的用户权限问题,确保 \User 可以读取 ext 文件夹,这对我有用

回答by gourav singh

I think you should use XAMPP 1.8.3-1, XAMPP 1.8.2-2, XAMPP 1.8.1. Because these xampp versions also support Mysqli by default.

我认为您应该使用 XAMPP 1.8.3-1、XAMPP 1.8.2-2、XAMPP 1.8.1。因为这些 xampp 版本默认也支持 Mysqli。