xampp安装时mysql服务能启动,环境检查显示“MySQL未安装”

PHP7.0+

1.修改**\XAMPP\htdocs\bugfree\install\func.inc.php的checkMysql()函数如下:

function checkMysql()
{
    if(function_exists("mysqli_get_server_info"))
        {


                    $test = new mysqli("127.0.0.1", "root", "", "mysql");
                    if(!$test)  {
                                    echo"database error";
                    }else{
                                    echo"php env successful \n";
                                    $versionInfo = mysqli_get_server_info($test);
                                    printf("Server version: %s\n", mysqli_get_server_info($test));
                                    preg_match('/[^\d]*([\d\.]+)[^\d]*/', $versionInfo, $version);
                                    print_r($version);
                                    $version = isset($version[1]) ? $version[1] : $versionInfo;
                                    $test->close();
                                    return version_compare($version, '5.0', '>=');
                    }


        }
    return t('bugfree', 'Not Install');
}

2.修改上述文件中的 mysql_get_client_info()为mysqli_get_server_info();

3.刷新环境检查页面即可。

你可能感兴趣的:(xampp安装时mysql服务能启动,环境检查显示“MySQL未安装”)