cURL Error 1: Unsupported protocol: https

纵然是瞬间 提交于 2019-12-10 17:09:38

问题


All,

I am trying to HTTPS POST a SOAP request via PHP's cURL wrapper methods but keep getting the following cURL error: Error 1: Unsupported protocol: https, Any ideas why this is happening? The target URL is good and I'm able to reach it via commandline.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$this->apiURL);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-type: text/xml;charset=UTF-8',
    'Content-length: '.strlen($SOAPRequest),
    'SOAPAction: ""'
) ); 

curl_setopt($ch, CURLOPT_POSTFIELDS, $SOAPRequest);

curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

$result = curl_exec($ch);

回答1:


First check phpinfo();

If Curl is enabled in PHP as shown in the results of phpinfo() then

  • The problem could be an extraneous space in the MySQL field containing the URL. The error isn't that the "HTTPS" protocol is unsupported, it is that " HTTPS" (with leading space) is unsupported.



回答2:


Your PHP was compiled without SSL support.



来源:https://stackoverflow.com/questions/4673154/curl-error-1-unsupported-protocol-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!