社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
这个问题困扰了我很久,Call to undefined function mysqli_connect()
解决这个问题需要开启mysqli扩展
开启mysqli扩展需要这两个步骤缺一不可
1.在php.ini中搜索php_mysqli.dll
2.设置extension_dir指令
; 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_dir指令。
在php.ini里面搜索extension_dir
(注意这里不能填写相对路径,在我的环境中测试填相对路径无效)
extension_dir = “G:/web/php7.1/ext”
检查G:/web/php7.1/ext安装路径是否存在php_mysqli.dll(如果不存在应该是PHP安装包损坏,请重新下载)
3.开启成功
这个问题困扰了我好久,原因就是因为我没有适当地设置extension_dir指令。
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!