大家有没有安装过织梦问答模板,今天大兵安装了织梦问答模块,在网站前台打开织梦问答目录时,出现了这个错误“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);
}*/
}
好了,问题解决。
本篇文章发布于大兵SEO博客,为大兵原创内容,如若转载,请注明出处:https://www.zhuzhouren.cn/jianzhanjiaocheng/dedecms/1447.html,否则,禁止转载,谢谢配合!