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 for Mac 創建的dnsmasq容器連不上/不工作的問題2. docker安裝后出現Cannot connect to the Docker daemon.3. css - 定位為absolute的父元素中的子元素 如何設置在父元素的下面?4. javascript - angualr2中emit觸發一個方法然后怎么獲得這個promise的結果5. java - 請問在main方法中寫成對象名.屬性()并賦值,與直接參參數賦值輸錯誤是什么原因?6. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat7. java - Spring boot 讀取 放在 jar 包外的,log4j 配置文件,系統有創建日志文件,不寫入日志信息。8. javascript - 圖片鏈接請求一直是pending狀態,導致頁面崩潰,怎么解決?9. python - beautifulsoup獲取網頁內容的問題10. 怎么用css截取字符?
