您好我正在使用XAMPP版本v3.2.2,并且我尝试在PHP CURL Lib中使用API。但是在每次请求时我都收到此错误消息:
协议"卷曲https" libcurl中不支持或禁用
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'curl https://dawanda.com/[XYZ]/products?v=1.1',
CURLOPT_HTTPHEADER => array('X-Dawanda-Auth: [XYZ]')
));
$resp = curl_exec($curl);
echo curl_error($curl);
curl_close($curl);
我不理解错误消息,因为https协议列在phpinfo()中。
答案 0 :(得分:3)
删除网址中的'curl'CURLOPT_URL => 'curl https://dawanda.com/[XYZ]/products?v=1.1'以便
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://dawanda.com/[XYZ]/products?v=1.1',
CURLOPT_HTTPHEADER => array('X-Dawanda-Auth: [XYZ]'),
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false
));
$resp = curl_exec($curl);
echo curl_error($curl);
curl_close($curl);