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. mysql - 百萬行的表中是否盡量避免使用update等sql語句?2. shell - Update query wrong in MySQL3. node.js - mysql如何通過knex查詢今天和七天內的匯總數據4. Python從URL中提取域名5. mysql 插入數值到特定的列一直失敗6. python - 在使用Pycharm時經常看到如下的樣式,小括號里紅色的部分是什么意思呢?7. javascript - 用jsonp抓取qq音樂總是說回調函數沒有定義8. 360瀏覽器與IE瀏覽器有何區別???9. javascript - 新浪微博網頁版的字數限制是怎么做的10. 怎么在網頁中設置圖片進行左右滑動
