mysqli_connect():php_network_getaddresses:getaddrinfo失败:名称或服务未知 [英] mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known

查看:75
本文介绍了mysqli_connect():php_network_getaddresses:getaddrinfo失败:名称或服务未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

im正在主要使用数据库的网站上工作.问题是我收到以下错误:mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known 我不知道如何解决它.我已经检查了连接,看来还可以.

im working on a website which mostly uses the database. the problem is that im geting the following error: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known I cant figure out how to fix it. I've penta-checked the connect and it seems to be okay.

function connect($hostname, $username, $password, $database)
{
    $conid = mysqli_connect($hostname, $username, $password, TRUE);


    if($conid == FALSE)
    {
        if(DEBUG == TRUE)
        {
            show_error("MySQL Connection using `$hostname`, `$username`, `$password` was refused");
        }

        return;
    }

    else
    {
        $dbid = mysqli_select_db($database, $conid);

        if($dbid == FALSE)
        {
            if(DEBUG == TRUE)
            {
                show_error("MySQL could not connect to database `$database`");
            }

            return;
        }

        else
        {
            self::$connections[] = $conid;
            self::$connection    = $conid;
        }
    }
}

该代码在2010年编写,然后以某种方式起作用.可以修复吗?

The code is writen in 2010 and then somehow it worked. Is it possible to fixit?

推荐答案

这是服务器托管问题.您必须向托管服务商查询.

It's the server hosting issue. You'd have to check with the hosting.

您还可以通过此链接阅读更多提示: http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/

You can also read more tips at this link: http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/

这篇关于mysqli_connect():php_network_getaddresses:getaddrinfo失败:名称或服务未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆