|
我们安装了织梦问答模块后,第一次访问问答有时会打不开,出现这个错误“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\r\n");
- fputs($fp, "Host: $host\r\n");
- fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
- fputs($fp, "Content-length: ".strlen($str)."\r\n");
- fputs($fp, "Connection: close\r\n\r\n");
- fputs($fp, $str."\r\n\r\n");
- 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\r\n");
- fputs($fp, "Host: $host\r\n");
- fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
- fputs($fp, "Content-length: ".strlen($str)."\r\n");
- fputs($fp, "Connection: close\r\n\r\n");
- fputs($fp, $str."\r\n\r\n");
- fclose($fp);
- }*/
- }
复制代码
好了,问题解决。
|
|