【问题标题】:How to enable mysqli on XAMPP?如何在 XAMPP 上启用 mysqli?
【发布时间】:2012-08-23 14:50:48
【问题描述】:

通过查看 Internet 上的建议,我尝试将所有查询转换为 mysqli。

但是 mysqli 在我的 XAMPP 中不起作用。我检查了我的 PHP 文件夹,有一个 php_mysqli.dll 文件...仍然无法正常工作

【问题讨论】:

    标签: php mysqli xampp


    【解决方案1】:

    你有没有把它声明给 php.ini 来加载它?如果没有,请尝试在 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
    

    【讨论】:

    • 应用设置后重新启动 xampp。
    • 我已经仔细检查过,没关系:extension=php_mysqli.dll 我已经在我的情况下尝试了你的建议:extension_dir = "C:\xampp\php\ext" 我已经重新启动了 Apache 服务,但仍然没有运气!我已经验证这是PHPMyAdmin 使用的这个php.ini 文件,但我仍然收到"You are using PHP's deprecated 'mysql' extension, which is not capable of handling multi queries. <b>The execution of some stored routines may fail!</b> Please use the improved 'mysqli' extension to avoid any problems."任何其他建议??
    • 谢谢。我用的是XAMPP v3.0.12,前几天刚下载。我没有足够的时间单独安装所有组件,我知道这样更好,但现在我将使用这个多合一包。谢谢你=)
    【解决方案2】:

    进入目录phpMyAdmin,发现有一个名为config.inc.php的文件,打开文件,找到一行:
    $cfg['Servers'][$i]['extension'] = 'mysql';
    只需将mysql 更改为mysqli

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        【解决方案4】:

        我认为您应该使用 XAMPP 1.8.3-1、XAMPP 1.8.2-2、XAMPP 1.8.1。 因为这些xampp版本也默认支持Mysqli。

        【讨论】:

          猜你喜欢
          • 2017-03-12
          • 2018-09-14
          • 2011-10-26
          • 2016-11-04
          • 2018-04-13
          • 1970-01-01
          • 2020-09-30
          • 1970-01-01
          • 2016-12-07
          相关资源
          最近更新 更多