[英]Uncaught Error: Class 'mysqli' not found on Windows 10 with Apache 2.4, PHP 7.4
System/Software:系统软件:
PHP Script PHP 脚本
if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
echo 'We don\'t have mysqli!!!';
} else {
echo 'Phew we have it!';
}
Yields: We don't have mysqli!!!
产量:
We don't have mysqli!!!
phpinfo phpinfo
php.ini directives php.ini 指令
extension_dir = "ext"
extension=mysqli
Looking at the phpinfo
, it seems like mysqlnd
is loaded, but mysqli
is not.查看
phpinfo
,似乎mysqlnd
已加载,但mysqli
未加载。 I don't know how to get it loaded.我不知道如何加载它。
Question问题
How do I load mysqli
module on Windows, when it seems like I already have directives in php.ini
to have it be loaded?我如何在 Windows 上加载
mysqli
模块,似乎我已经在php.ini
中有指令来加载它?
Update - I found these更新 - 我找到了这些
phpinfo()
reports: Configuration File (php.ini) Path: C:\Windows
phpinfo()
报告:配置文件 (php.ini) 路径: C:\Windows
phpinfo()
reports: Loaded Configuration File: (none)
phpinfo()
报告:加载的配置文件:( (none)
php.ini
file is located in C:\php\php.ini
php.ini
文件位于C:\php\php.ini
When setting up previous versions of PHP Configuration File Path used to be C:\php\php.ini
.在设置以前版本的 PHP 时,配置文件路径曾经是
C:\php\php.ini
。 Move to C:\Windows
seems to be new, and that is what threw me off.移动到
C:\Windows
似乎是新的,这就是让我失望的原因。 If someone can find a proper official docs or guide where this is explained or documented, I will appreciate it.如果有人可以找到适当的官方文档或指南来解释或记录这一点,我将不胜感激。 I was not able to successfully find proper installation instructions for PHP just yet, and was going by memory of my previous experiences.
我还没有成功找到 PHP 的正确安装说明,并且我之前的经验是 memory。
My Configuration File (php.ini) Path
was blank, and for whatever reason, PHP was looking for php.ini
file in C:\Windows
, and not in C:\php
, where I usually had it in the past. My
Configuration File (php.ini) Path
was blank, and for whatever reason, PHP was looking for php.ini
file in C:\Windows
, and not in C:\php
, where I usually had it in the past. I moved my php.ini
file into C:\Windows
, and it seems like we are happy again.我将我的
php.ini
文件移动到C:\Windows
中,看起来我们又开心了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.