php7使用SSL協議訪問webservice出現問題
問題描述
錯誤為:SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://xxxxx/api?wsdl' : failed to load external entity "https://xxxxxxx/api?wsdl" in D:wwwcompare.php:22 Stack trace: #0 D:wwwcompare.php(22): SoapClient->SoapClient('https://xxx...', Array) #1 {main}
代碼如下:
$opts =array('http' => array('user_agent' => 'PHPSoapClient'),'ssl'=>array('verify_peer'=>false ,'verify_host'=>false,"verify_peer_name"=>false));
$url="https://xxxxxxx/api?wsdl";
$params= array('encoding' => 'UTF-8','soap_version'=>SOAP_1_1,'trace' => 1, "exceptions" => 1, "connection_timeout" => 180,'username' => 'xx', 'password' => '*****','stream_context' => stream_context_create($opts));
$client =new SoapClient($url,$params);
另外php.ini配置沒有問題,openssl和soap已經打開
請問下各位大佬,怎么解決????
問題解答
回答1:系統環境為windows2012+apche2.4+PHP7.2
相關文章:
1. 如何解決docker宿主機無法訪問容器中的服務?2. docker 下面創建的IMAGE 他們的 ID 一樣?這個是怎么回事????3. javascript - 請指條明路,angular的$event,在select中卻是undefined?4. 如何修改vim插件vimwiki中Vimwiki2HTML的一些細節5. javascript - JS事件委托問題6. javascript - 關于jquery的remove()方法7. JavaScript中怎么理解=、==和===8. java - Spring事務回滾問題9. javascript - vue.js如何遞歸渲染組件.10. mongodb - Mongo java驅動中,有沒有封裝好的函數,可以直接取到文檔中的某個具體的值,而不是一個文檔?或者有沒有方法實現??
