我创建了一个新的SoapClient对象。但是,当尝试调用方法发送请求时,会发生以下错误:
PHP致命错误:未捕获的SoapFault异常:[HTTP]无法连接到/opt/CCM.php:274中的主机
堆栈跟踪:
0 [内部功能]:SoapClient-> __ doRequest('
1 /opt/CCM.php(274):SoapClient-> __调用(“ executeSQLQuery”,数组)
2 /opt/index.php(95):CCM-> getInfoByLine()。
在php 5.4上,一切正常。
我尝试过:
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);
这:
Disable certificate verification in PHP SoapClient
index.php
$qq= new CCM($config['url']);
$w = $qq->getInfoByLine();
CCM.php
{
public function __construct($url) {
$this->cl2 = new SoapClient($_SERVER['DOCUMENT_ROOT']."/../config/CCM.wsdl",
array('location'=>$url,
'login'=>'login',
'password'=>'pass', )
);
}
public function getInfoByLine($num='') {
$this->cl2->executeSQLQuery(array("sql" => "SELECT ..."));
if (isset($res2->return->row)) {
$this->user = $res2->return->row;
return $res2->return->row;
}
}
}
我希望请求成功