织梦CMS问答页面打不开,报错service.dedecms.com Unable to find the socket transport,出现这个错误,找到ask/data/scores.inc.php文件,并找到下面的代码,直接注释掉 transport() 里面的内容,问题就解决了.
大家有没有安装过织梦问答模板,今天大兵安装了织梦问答模块,在网站前台打开织梦问答目录时,出现了这个错误“service.dedecms.com Unable to find the socket transport”,下面大兵把解决这个问题的方法分享如下:
找到织梦问答模板中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);
}
}
直接将如下标红的代码注释掉就行了
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);
}*/
}
好了,问题解决。