php 致命错误:调用未定义的函数 mysqli_init()
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4921599/
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
Fatal error: Call to undefined function mysqli_init()
提问by Daniele Pozzobon
I have a really strange error. My httpd server have been working fine until last Wednesday, when I uninstalled the MS SQL and visual studio C#. When I restarted the PC, Ii discovered that some parts of the Environment variable PATH disappeared...Almost all the problems where recovered, The only one that cannot be adjusted is my httpd server... or the PHP configuration, I don't know. I have already uninstalled the Apache server, PHP and MySql and resintalled them again... I have done this lots of times on other PCs so I'm sure that it should work...but I'm missing something.
我有一个非常奇怪的错误。我的 httpd 服务器一直运行良好,直到上周三我卸载了 MS SQL 和 Visual Studio C#。重启电脑后发现环境变量PATH有的部分消失了...几乎所有问题都恢复了,唯一不能调整的就是我的httpd服务器...或者PHP配置,我没有知道。我已经卸载了 Apache 服务器、PHP 和 MySql 并重新安装了它们……我在其他 PC 上已经做过很多次了,所以我确定它应该可以工作……但我错过了一些东西。
The worst thing is that the data I get when I do in cmd "php -i" is different form the data I get form a page info.php like this:
最糟糕的是,我在 cmd "php -i" 中获得的数据与我从页面 info.php 获得的数据不同,如下所示:
<?php
phpinfo();
?>
The page doesn't show any info about the mysqli configuration...
该页面没有显示有关 mysqli 配置的任何信息...
can any body help me? I'm trying anything to avoid formatting the PC!!!
有谁能够帮助我?我正在尝试任何方法来避免格式化 PC !!!
Thanks in advance
提前致谢
Update:::::::::::::::::::::::::: With phpinfo I find:
Update:::::::::::::::::::::::::: 使用 phpinfo 我发现:
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\PHP\php.ini
In C:\windows there's no php.ini file. Where else can PHP find other configurations?
在 C:\windows 中没有 php.ini 文件。PHP 还能在哪里找到其他配置?
回答by ZEE
Open the folder you installed PHP Edit php.ini file
打开你安装 PHP 的文件夹 编辑 php.ini 文件
If no php.ini exists, copy one of the php.ini/Production/Development to php.ini
如果不存在 php.ini,请将 php.ini/Production/Development 之一复制到 php.ini
uncomment
extension=php_mysqli.dll
if you have not installed php in the default folder... or if you have the php extensions in a separated folder change the extension_dir to the correct path
如果您没有在默认文件夹中安装 php...或者如果您在单独的文件夹中有 php 扩展,请将 extension_dir 更改为正确的路径
change
extension_dir = "C:/APL/php/ext/"