简体   繁体   English

如何在 XAMPP 上启用 mysqli?

[英]How to enable mysqli on XAMPP?

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.但是 mysqli 在我的 XAMPP 中不起作用。 I checked my PHP folder and there is a php_mysqli.dll file... still it doesn't work我检查了我的 PHP 文件夹,发现有一个php_mysqli.dll文件……还是不行

Have you declare it to php.ini to load it?你有没有把它声明到 php.ini 来加载它? If no, try find this in php.ini and add php_mysqli.dll如果没有,请尝试在 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

Goto the directory phpMyAdmin , find there is a file with name config.inc.php , open the file and find a line there as:转到目录phpMyAdmin ,找到一个名为config.inc.php的文件,打开该文件并在那里找到一行:
$cfg['Servers'][$i]['extension'] = 'mysql' ; $cfg['Servers'][$i]['extension'] = 'mysql' ;
just change mysql to mysqli .只需将mysql更改为mysqli

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

I think you should use XAMPP 1.8.3-1, XAMPP 1.8.2-2, XAMPP 1.8.1.我认为您应该使用 XAMPP 1.8.3-1、XAMPP 1.8.2-2、XAMPP 1.8.1。 Because these xampp versions also support Mysqli by default.因为这些 xampp 版本默认也支持 Mysqli。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM