N
N
Noob--Saibot2017-08-17 12:03:20
PHP
Noob--Saibot, 2017-08-17 12:03:20

Denwer Curl and Https how to fix error?

Hi all. Please help me figure it out. I'm trying to get data from the prom_ua/sitemap_models-1.xml file on the local server (denwer) with Curl. I do everything as usual, but I get an error - Protocol https not supported or disabled in libcurl. How to fix it?

function curl_get_page($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2017-08-17
@Noob--Saibot

Set CURLOPT_SSL_VERIFYPEER to true.
Alternative verified certificates can be specified using the CURLOPT_CAINFO option or a certificate directory specified by the CURLOPT_CAPATH option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question