【问题标题】:Fatal error: Call to undefined function mysql_connect() and The mysqli extension is missing致命错误:调用未定义函数 mysql_connect() 并且缺少 mysqli 扩展
【发布时间】:2014-12-17 14:23:29
【问题描述】:
  1. 我的 php.ini 文件中有以下两个

    extension=php_mysql.dll
    extension=php_mysqli.dll
    
  2. 从php.info(),可以看出下面是正确的。

    Loaded Configuration File   C:\Program Files (x86)\PHP\v5.3\php.ini
    
  3. 我只安装了一个版本的 php。

我还应该尝试什么?

奇怪的是,如果我加载我的应用程序,错误是

致命错误:调用未定义函数 mysql_connect()

但如果我加载 phpMyAdmin,登录后错误是

The mysqli extension is missing. Please check your PHP configuration.
<a href="Documentation.html#faqmysql" target="documentation"><img class="icon" src="./themes/pmahomme/img/b_help.png" width="11" height="11" alt="Documentation" title="Documentation" /></a>

【问题讨论】:

  • 使用xampp或者Easyphp或者类似的软件可以帮助o_o
  • 如果您对任何.ini/系统文件进行了任何更改,那么您需要重新启动包括Apache在内的所有服务。还添加错误报告。如果可能,请尝试全新安装,并确保您的文件为.php。我注意到那里有一个.html 链接。
  • 当你看到,phpinfo 是正确的,你的意思是,你看到了其中的 2 个扩展?并且不要忘记,在 windows 下,这些 dll 有依赖,有时这会导致错误:libmysql.dlllibmysqli.dll php.net/manual/en/install.windows.extensions.php
  • 嗨,我正在使用 IIS。 iisreset,mysql重启了吗。问题不在这里。
  • 您应该会在 phpinfo 显示中看到该信息。如果没有,您需要重新启动服务器。

标签: php mysql iis mysqli


【解决方案1】:

确保 php.ini 的路径已设置并且在 在加载的配置文件中。

如果您使用的是 windows.. 确保使用 / 和 \ 在 apache httpd.conf 它应该是 PHPIniDir "C:/php/5.5/"

【讨论】:

    猜你喜欢
    • 2012-05-23
    • 1970-01-01
    • 2016-11-21
    • 2011-10-04
    • 2016-08-07
    • 2016-04-07
    相关资源
    最近更新 更多