网页特效代码_站长素材站移动版

DeDecms教程

主页 > CMS教程 > DeDecms教程 >

织梦dedeCMS问答页面打不开,出现service.dedecms.comphp_network_getaddresses

我们安装了织梦问答模块后,第一次访问问答有时会打不开,出现这个错误“service.dedecms.comphp_network_getaddresses: gethostbyname failed. errno=20”,解决这个问题,请按照下面的方法修改即可。

找到ask/data/scores.inc.php文件,并找到下面的代码:

function transport()
{ 
    global $cfg_basehost;
    $path = $cfg_basehost.'/'.APPNAME."/?ct=index&ac=scores";
    $host = preg_replace('##','',$cfg_basehost);
    $str = "";
    $fp = fsockopen($host,80,$errno,$errstr,30);
    if(!$fp)
    {
        die("service.dedecms.com".$errstr.$errno);
    }else{
        fputs($fp, "POST $path HTTP/1.1 ");
        fputs($fp, "Host: $host ");
        fputs($fp, "Content-type: application/x-www-form-urlencoded ");
        fputs($fp, "Content-length: ".strlen($str)." ");
        fputs($fp, "Connection: close ");
        fputs($fp, $str." ");
        fclose($fp);
    }
}

直接注释掉 transport() 里面的内容就可以了

function transport()
{  
   /* global $cfg_basehost;
    $path = $cfg_basehost.'/'.APPNAME."/?ct=index&ac=scores";
    $host = preg_replace('##','',$cfg_basehost);
    $str = "";
    $fp = fsockopen($host,80,$errno,$errstr,30);
    if(!$fp)
    {
        die("service.dedecms.com".$errstr.$errno);
    }else{
        fputs($fp, "POST $path HTTP/1.1 ");
        fputs($fp, "Host: $host ");
        fputs($fp, "Content-type: application/x-www-form-urlencoded ");
        fputs($fp, "Content-length: ".strlen($str)." ");
        fputs($fp, "Connection: close ");
        fputs($fp, $str." ");
        fclose($fp);
    }*/
}

好了,问题解决。

(责任编辑:admin)

    468x60